- Qt Creator Manual
- Getting Help
- How-to
- Search and replace across files using a regular expression
- Qt Creator Manual 11.0.3

Perform calculations ◦ Select the enclosing block in C++

# 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)`):

1. Ensure that any work you have done is committed to version control, as the changes cannot be undone.
2. Press Ctrl+Shift+F to bring up the Advanced Find form.
3. Change the scope to whatever is appropriate for your search.
4. Under the Search for text field, select the Use regular expressions check box.
5. Enter the following text in the Search for text field:

        if \((.*) == (.*)\)

6. Press Search & Replace to see a list of search results.
7. In the Replace with text field, enter the following text:

        if (\1.strictlyEquals(\2))

8. Press Replace to replace all instances of the text.

For more information, see Advanced Search.

Perform calculations ◦ Select the enclosing block in C++