\ingroup
creator-how-to-edit
\title
Search and replace across files using a regular expression
As an example, say you want to replace equality checks (foo == bar
) with a function (foo.equals(bar)
):
- Ensure that any work you have done is committed to version control, as the changes cannot be undone.
- Press Ctrl+Shift+F to bring up the Advanced Find form.
- Change the scope to whatever is appropriate for your search.
- Under the Search for text field, select the Use regular expressions check box.
- Enter the following text in the Search for text field:
if \((.*) == (.*)\)
- Press Search & Replace to see a list of search results.
- In the Replace with text field, enter the following text:
if (\1.strictlyEquals(\2))
- Press Replace to replace all instances of the text.
For more information, see Advanced Search.