This section describes user interface elements designed for search and replace.
Use Find and Replace window for searching and replacing text in the code editor. To access this window, choose the required command from the Find and Replace submenu of the Edit menu when editing a document.
Find
This button allows you to switch between the Find and Find in Files dialogs.
Find
The search will be performed in the open document.
Find in Files
The search will be performed in the selected files, project, or folders. If this option is selected, the Find and Replace window provides additional options. You can create a set of selected folders, specify search file types, and set result options. For more information, see the Find/Replace in Files Dialog Box section below.
Replace
This button allows you to switch between the Replace and Replace in Files dialogs.
Replace
The search will be performed in the open document. The occurrences will be replaced with the replacement string.
Replace in Files
The search will be performed in the selected files, project, or folders. The occurrences will be replaced with the replacement string. For more information, see the Find/Replace in Files Dialog Box section below.
Find what
This combo-box allows you to specify a string or a regular expression you want to look for. You can do the following:
Replace with
Specify the replacement string in this combo-box.
Look in
Select search location here.
Current Document
Search will be performed in the current document only.
All Open Documents
Search will be performed in all open documents.
Entire Solution
(available only in the Visual Studio add-in) Search will be performed in the open solution.
Find Options
Match case
Enables case sensitive search.
Match whole word
The string will not be found/replaced if it is not a whole word.
Search hidden text
Search in collapsed text areas (such as regions, definitions and others) will be also performed.
Search up
Search will be performed in reverse direction.
Use
Select this check-box to activate the use of regular expressions or wildcards in search strings.
Regular expressions
A regular expression is a pattern of text that consists of ordinary characters (for example, letters a through z) and special characters, known as metacharacters. The pattern describes one or more strings to match when searching text. If this option is selected, the arrow button next to the Find what combo-box becomes active. You can press the button and select the required regular expression to add to the Find what combo-box. For detailed information about the list of regular expressions, see Regular Expressions for Find and Replace.
Wildcards
This is a list of expressions to replace characters or digits in the Find what combo-box. For detailed information about the list of regular expressions, see Wildcards for Find and Replace.
Find Next
Click this button to search the next occurrence in the document.
Replace
Click this button to search the next occurrence in the document or replace the selected one.
Replace All
Click this button to replace all occurrences in search location.
Use the Find and Replace window to find and replace text in the selected files. To access this window, in the Edit menu select the Find and Replace submenu, and then choose Find in Files or Replace in Files.
Find in Files
This button allows you to switch between the Find and Find in Files dialogs.
Find
The search will be performed in the open document.
Find in Files
The search will be performed in the selected files, project, or folders. If this option is selected, the Find and Replace window provides additional options. You can create a set of selected folders, specify search file types, and set result options.
Replace in Files
This button allows you to switch between the Replace and Replace in Files dialogs.
Replace
The search will be performed in the open document. The occurrences will be replaced with the replacement string.
Replace in Files
The search will be performed in the selected files, project, or folders. The occurrences will be replaced with the replacement string.
Find what
This combo-box allows you to specify a string or a regular expression you want to look for. You can do the following:
Replace with
Specify the replacement string in this combo-box.
Look in
Select search location here, for this, either select options from the drop-down list, or create a new set of folders in the Choose Search Folders dialog. The drop-down list contains the following options:
Current Document
Search will be performed in the current document only.
All Open Documents
Search will be performed in all open documents.
Entire Solution
(available only in the Visual Studio add-in) Search will be performed in the current solution.
Choose Search Folders
Click this button next to the Look in combo-box, to open the Choose Search Folders dialog box and create a custom named folder list.
Include sub-folders
Select this check-box to include the sub-folders within the folder set selected in the Look in combo-box.
Find Options
Match case
Enables case sensitive search.
Match whole word
The string will not be found/replaced if it is not a whole word.
Use
Select this check-box to activate the use of regular expressions or wildcards in search strings.
Regular expressions
A regular expression is a pattern of text that consists of ordinary characters (for example, letters a through z) and special characters, known as metacharacters. The pattern describes one or more strings to match when searching text. If this option is selected, the arrow button next to the Find what combo-box becomes active. You can press the button and select the required regular expression to add to the Find what combo-box. For detailed information about the list of regular expressions, see Regular Expressions for Find and Replace.
Wildcards
This is a list of expressions to replace characters or digits in the Find what combo-box. For detailed information about the list of regular expressions, see Wildcards for Find and Replace.
Look at these file types
Select the required file types from the drop-down list. The search will be performed only in files of the selected type.
Result Options
Display file names only
Select this check-box to show one entry per file containing a search match.
Keep modified files open after Replace All
Select this check-box to leave all modified files open after Replace All is performed. It will allow you to undo or save changes in files.
Find All
Click this button to search for all occurrences in the search location. Available for Find in Files mode.
Find Next
Searches the next occurrence in the document. Available for Replace in Files mode.
Replace
Click this button to search the next occurrence in the document or replace the selected one. Available for Replace in Files mode.
Replace All
Click this button to replace all occurrences in search location. Available for Replace in Files mode.
This dialog allows you to create, save, and revise your own set of search folders, and to specify the order in which they are searched. To open this dialog, press the Choose Search Folders button next to Look in combo-box.
Folder set
Shows folders available for search. To create a new folder set, enter a name, add a set of search folders to the Selected folders list, and then click the Apply button.
Apply
Saves the set of search folders in the Selected folders list as a named folder set. This folder set then can be chosen in the Look in combo-box on all tabs of the Find and Replace window. Leaves the Choose Search Folders dialog box open.
Delete
Removes the selected folder set from the Folder set field, and from the Look in combo-box on all tabs of the Find and Replace window.
Available folders
Select a previously selected folder from the drop-down list to populate the Selected folders list.
List of Folders
Shows drives and folders available within the folder selected in the Available folders drop-down list. Double-click to expand any drive or folder listed. Select a folder, or hold down the SHIFT or CONTROL keys to select multiple folders. To add the selected folder to the Selected folders list, press the right arrow button. To remove a selected folder, press the left arrow button.
Up
This button moves the selection in the Available folders list one level higher in the folder hierarchy.
Selected folders
Lists folders added from the Available folders list. These folders will be included in the named folder set.
Arrow buttons
The arrow buttons between the Available folders list and the Selected Folders list:
The arrow buttons to the left of the Selected Folders list:
OK
Saves the set of search folders listed in Selected folders list as a named folder set. This folder set then can be chosen in the Look in combo-box on all tabs of the Find and Replace window. Closes the Choose Search Folders window.
Cancel
Discards all changes and closes the Choose Search Folders window.
The Find Results window allows you to navigate text search results. It provides the following search results: file name, line number and part of the text, containing the match. You can double-click on matches to navigate to them. The Find Results window has following toolbar buttons.
Go to the location on the current line
Moves the caret to the selected line location of the match found.
Go to the previous location in the list
Moves the caret to the selected line location of the previous match found.
Go to the next location in the list
Moves the caret to the selected line location of the next match found.
Clear All
Clears the Find Results window.