Find text in files

You can use the Find in Files mode to search for text across specific folders on your computer. You can also create and save folder sets to reuse the same search locations in future searches.

To search files:

1. Press Ctrl+Shift+F or select Edit > Find and Replace > Find in Files.

2. In Find what, enter the text you want to find or a search pattern.

Note

To use wildcard characters or regular expression syntax elements, enable Use > Wildcards or Use > Regular Expressions in step 4, then click the Expression Builder button arrow button next to the Find what field and choose the desired element from the list.

3. In Look in, select the Ellipsis button ellipsis button and choose folders to search:

  • Select one or more folders from the Available folders list. Click the Arrow button arrow to add them to the Selected folders list.

  • Optional: To save this combination for future use, in Folder set, select Unnamed folder set, enter the name for the set, and then click Apply.

Find in files tab and Choose search folders dialog

After selecting the folders, click OK.

4. Optional: Customize the search using the following options.

  • Match case – Finds text that matches the exact capitalization (for example, “CREATE” will not match “create”).

  • Match whole word – Finds only complete words, not parts of words (for example, “table” will not match “tables” or “portable”).

  • Use > Wildcards – Allows wildcard characters such as * and ?. For example, table* finds table, tables, and tablespace. After you select Wildcards, the Expression Builder button arrow button next to Find what becomes active—click it to choose the desired element from the list. For more information, see Wildcards.

  • Use > Regular Expressions – Enables regex-based searches. After you select Regular expressions, the Expression Builder button arrow button next to the Find what field becomes active—click it to choose the desired element from the list. For more information, see Regular Expressions.

Regex in the Find and Replace window

5. In Look at these file types, specify the file type to search. To search across all file types, select *.* all file types.

For a complete list of file type options, see File type filters later on this page.

6. Optional: To show only file paths in the Find Results window without line numbers and the replacement text, select Display file names only.

7. Start the search:

  • To locate and highlight the first matching result one at a time, click Find Next.

  • To display the complete list of matches, click Find All.

When you click Find All, all occurrences found in the searched folders are listed in the Find Results window:

Find text in files: Results

In this example, the search pattern bikestore finds all occurrences of the word “bikestore” across all files in the selected folders.

For more information on how to navigate occurrences in the Find Results window, see Find Results window.

File type filters

This table describes the file type filters available for narrowing search and replace operations in the Find and Replace windows.

File Type Search Scope
*.* Search all file types.
*.dbd Search database diagram files.
*.rdb Search data reports files.
*.dcomp Search data comparison files.
*.scomp Search schema comparison files.
*.dgen Search data generation files.
*.ddoc Search database documentation files.
*.ssp Search SQL Server event profiler files.
*.txt Search text files.
*.xml Search XML files.
*.sql Search SQL script files.
*.sqlplan Search SQL execution plan files.
*.mdet Search master-detail browser files.
*.snap Search snapshot files.