Find and replace text in solution
Edit | Find | Find in Files CtrlShift0F
Edit | Find | Replace in Path CtrlShift0H
You can search and replace text in the entire solution, project, any directory with its nested hierarchy, or in any scope. Explore search results in the preview tab or in the Find window.
tip
If you are looking for types, members, files, actions, or settings, use Search Everywhere (Ctrl0T or Shift twice).
If you want to search only specific part of your solution, select the corresponding node in the Explorer tool window CtrlAlt0L.
Press CtrlShift0F or choose Edit | Find | Find in Files.
In the Find in Files dialog, enter the search string.
If necessary, specify the search options.
You can click
or press Alt0↓ to show the list of recent search entries.
To search for a multi-line fragment, click
in the search field or press CtrlShiftEnter
To return to a single-line mode, press Backspace.
To restrict your search by file types, select File mask, and then choose the desired mask or specify a new one using wildcards:
*
to substitute a set of any characters,?
to substitute a single character,!
to exclude files. Note that!
should go first in a particular file name pattern, for example,!*.xml
You can specify multiple file masks, delimited with commas (for example,
*.xml,a?c.sql,!*.html
).Note also, that negated pattern (for example,
!*.min.js
) has implicit inclusion pattern*
. This allows avoiding such constructs as*, !*.min.js
for every file except minified javascript).If there is no search text and this checkbox is selected, JetBrains Rider will find all files matching the specified mask, regardless of their contents.
To restrict your search by a project, directory or specific scope, use the selector under the search field.
When invoked for the second (and subsequent) time, the dialog opens with the scope that has been selected previously. For example, if the scope has been Directory, the next time you invoke the dialog, the scope again will be Directory.
Results that match your query are listed as you type. When the query is complete, you can study the results:
Press 0↑/0↓ to select matching strings and study their context in the preview pane.
Edit code right in the preview pane as it is a functional editor where actions such as Ctrl0F or AltEnter are available.
You can select text and press CtrlShift0F to start a new search right from the preview pane.
Press Enter to open the selected result in the editor.
Click Open in Find Window CtrlEnter to see all of the results in the Find window.
If the search takes too much time, click Background in the search progress window. In this case the search progress is indicated in the Status bar.
tip
If the file that JetBrains Rider tries to load exceeds 20 MB, it will be ignored. To configure the file size, use the
idea.max.content.load.filesize
property in the idea.properties.
In contrast to other navigation and search commands, the results of Find in Files CtrlShift0F are by default displayed in the same tab of the Find window. If you want the results of previous textual searches to be preserved in different tabs, select Open Results in New Tab in the bottom left corner of the Find in Files popup:
![JetBrains Rider: Open results in new tab JetBrains Rider: Open results in new tab](https://resources.jetbrains.com/help/img/rider/2024.3/open_results_in_new_tab.png)
Press CtrlShift0H or select Edit | Find | Replace in Path from the main menu.
In the Replace In Path dialog, specify the search and replace strings, search options, and the scope.
If you specify the search or replacement text through a regular expression, use the
$n
format in back references (to refer to a previously found and saved pattern).To use a backslash character
\
in a regular expression, escape the meaningful backslash by inserting three extra backslashes in a preposition:\\\\
.
You can view and analyze the matching occurrences the same way as with the search. Note the if you click Open in Find Window CtrlEnter, replace commands will be still available for the results.
Click Replace All to replace all matching occurrences or Replace to replace items one by one.
To switch from the Find in Files to Replace In Path window, press CtrlShift0H.
To switch from the Replace In Path to Find in Files window, press CtrlShift0F.
| Show the history of the recent entries. |
Clear the search field. | |
| Enable entering the search string in several lines. Even without this option, you can search for multiline matches with regular expressions and escape characters. |
| Distinguish between upper and lowercase letters while searching. |
| Search for whole words only, that is, for character strings separated with spaces, tabs, punctuation, or special characters. This option is unavailable if Regular expressions is selected. |
| Process the search query as a regular expression. |
| Invoke the list of additional options, for example to confine the search to comments or string literals. |
| When replacing strings, use the casing of each occurrence for replacements. For example, when replacing This option is unavailable if Regular expressions is selected. |