- On the main menu, choose , or press Ctrl+F Command F or Alt+F3 Alt F3. The search pane appears on top of the active editor.
- If necessary, specify the search options.
- In the search field, start typing the search string:

As you type, the first occurrence of the search string after the current cursor position is selected; the other occurrences are highlighted in the editor. In addition, the matching occurrences are marked in the right gutter with stripes.

- Explore search results.
- On the main menu, choose , or press Ctrl+RCommand R. The search and replace pane appears on top of the active editor.
- If necessary, specify the search and replace options.
- In the search field, start typing the search string. As you type, the matching occurrences are highlighted in the editor, and a replace dialog box pops up automatically at the first occurrence, suggesting you to replace the current occurrence, or all of them, with an empty string.
- Start typing the replacement string. It is immediately reflected in the replace dialog box.
Note that for the regular expressions replacement preview is shown at the tooltip.

- Explore search results, and, using the buttons of the replace dialog box, replace occurrences as required.
- To initiate a new search, do one of the following (depending on the current focus):
- If the editor has the focus, press Ctrl+F Command F or Alt+F3 Alt F3.
- If the search field has the focus, press Ctrl+ACommand A
In both cases, the existing search string will be selected, and can start typing a new one.
- To jump between occurrences, do one if the following:
- Press Shift+F3 Shift F3 or Ctrl+Shift+L Control Shift L or F3 F3 or Ctrl+L Control L.
- Use
or
buttons in the Search pane.
- Click the gutter stripes.
- The search pane shows the number of found occurrences. If no matches are found, the search pane is red highlighted:

- Use Code completion in Find and Replace panes. Start typing the search string, press Ctrl+SpaceControl Space, and select the appropriate word from the suggestion list.
- Use the recent history of searches: with the search pane already open, click
to show the list of recent entries.
- With the search or replace pane already opened, use Ctrl+RCommand R or Ctrl+F Command F or Alt+F3 Alt F3 to toggle between panes. So doing, the search and replace strings are preserved.
- To cancel operation and close the pane, press EscapeEscape.
Search and replace options
| Item | Description | Search/Replace |
|---|---|---|
|
Click this button to show the history of the recent entries. | Search, replace |
|
Click these buttons to navigate through the occurrences of the search string. | Search, replace |
|
|
Click this button to show search results in the Find tool window. | Search, replace |
![]() |
Click this button to enable entering the search string in several lines. If this button is not pressed,
you still can enter search strings that occupy several lines, but should work in the regular expression mode and use escape
characters.
For example:
|
Search, replace |
| Case sensitive | if this check box is selected, IntelliJ IDEA will distinguish between upper and lowercase letters while searching. | Search, replace |
| Match whole words only | if this check box is selected, IntelliJ IDEA will search for whole words only,
that is, for character strings separated with spaces, tabs, punctuation, or special characters. This check box is disabled, if the Regular expressions check box is selected. |
Search, replace |
| Regex | If this check box is selected, the search string will be perceived as a regular expression.
Note If this check box is selected, IntelliJ IDEA shows replacement preview in a tooltip, as shown in the image above. |
Search, replace |
| Preserve case | If this check box is selected, IntelliJ IDEA retains the case of the first letter
and the case of the initial string in general. For example,
MyTest will be replaced with Yourtest if you specify yourtest as the replacement. This check box is disabled, if Regular expressions check box is selected. |
Replace |
| Selection only | If this check box is selected, search and replacement will be confined to to the selected text only. | Replace |
| Exclude/Include | Click Exclude button to skip the current occurrence and exclude it from the Replace all operation. The button for this occurrence changes to Include. | Replace |
| Replace | Click this button to replace the current occurrence and proceed to the next one. | Replace |
| Replace all | Click this button the replace all found occurrences in the current file, or in the selection. | Replace |



