JetBrains Rider 2024.3 Help

Find and replace text in solution

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.

Find text in solution

  1. If you want to search only specific part of your solution, select the corresponding node in the Explorer tool window Alt+1.

  2. Press Ctrl+Shift+F or choose Edit | Find | Find in Files.

  3. In the Find in Files dialog, enter the search string.

  4. If necessary, specify the search options.

  5. You can click Search History or press Alt+Down to show the list of recent search entries.

  6. To search for a multi-line fragment, click Enter a new line in the search field or press Ctrl+Shift+Enter

    To return to a single-line mode, press Backspace.

  7. 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.

  8. To restrict your search by a project, directory or specific scope, use the selector under the search field.

    Search scope

    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.

  9. Results that match your query are listed as you type. When the query is complete, you can study the results:

    • Press Up/Down 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 Ctrl+F or Alt+Enter are available.

    • You can select text and press Ctrl+Shift+F to start a new search right from the preview pane.

      the Find in Files dialog
    • Press Enter to open the selected result in the editor.

    • Click Open in Find Window Ctrl+Enter to see all of the results in the Find window.

  10. 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.

In contrast to other navigation and search commands, the results of Find in Files Ctrl+Shift+F 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

Replace text in the solution

  1. Press Ctrl+Shift+R or select Edit | Find | Replace in Path from the main menu.

  2. 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: \\\\.

  3. You can view and analyze the matching occurrences the same way as with the search. Note the if you click Open in Find Window Ctrl+Enter, replace commands will be still available for the results.

  4. Click Replace All to replace all matching occurrences or Replace to replace items one by one.

Toggle between Find and Replace

  1. To switch from the Find in Files to Replace In Path window, press Ctrl+Shift+R.

  2. To switch from the Replace In Path to Find in Files window, press Ctrl+Shift+F.

Search and replace options

Search History Alt+Down

Show the history of the recent entries.

Clear

Clear the search field.

Enter a new line Ctrl+Shift+Enter

Enable entering the search string in several lines. Even without this option, you can search for multiline matches with regular expressions and escape characters.

Match case Alt+C

Distinguish between upper and lowercase letters while searching.

Words Alt+O

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.

Regex Alt+X

Process the search query as a regular expression.

Show filter popup Ctrl+Alt+F

Invoke the list of additional options, for example to confine the search to comments or string literals.

Preserve Case Alt+E

When replacing strings, use the casing of each occurrence for replacements. For example, when replacing foo with bar, Foo will be replaced with Bar, and FOO with BAR.

This option is unavailable if Regular expressions is selected.

Last modified: 16 December 2024