ReSharper 8.0 Web Help

Sometimes you need to find not just usages of a certain symbol or occurrences in text that match some regular expression, but pieces of source code that match a certain pattern. For example, to find code smells specific for your project or to find pieces of code that need to be refactored. ReSharper provides a powerful tool that helps find such custom code fragments.

To find occurrences of a code pattern
  1. On the main menu, choose ReSharper | Find | Search with Pattern. The Search with Pattern dialog box opens.
  2. Define a pattern in the Search pattern text area.



    Pay attention, that when you use a placeholder, its name should be enclosed with dollar signs (use the syntax $xx$, where xx represents placeholder name),whereas when you create a new placeholder, you should omit these special symbols.
  3. Specify the search scope using the Look in list.
  4. Click Find to start the search.
  5. Search results are shown in the Find Results window.

If the results do not actually include what you are looking for, you can quickly modify the pattern and invoke the search process once again. To do that, click Change Search Pattern Reference__Windows__Pattern_Catalogue__Edit_Pattern on the toolbar of the Find Results window.