Replace in Files Dialog Box
Allows you to make text substitutions in the current document or window as well as within multiple documents. You can access the Replace in Files dialog box by choosing Find in Files from the Edit menu.
Visual Studio automatically checks out files under source code control to make replacements. You can select to leave open all files that have been changed by selecting the Keep modified files open check box. Visual Studio does not automatically check the modified files back into source code control regardless of whether or not the Keep modified files open check box has been selected.
Results from replace operations appear in the Find Results 1 and Find Results 2 windows. You can choose to display only the file name information in the replace report by selecting the Display file names only checkbox.
- Find what
- Enter the text, along with wildcards or regular expressions, for which you intend to search. Select the drop-down list to display the last 16 items entered. Click the wedge button to view a quick reference list of select wildcard or regular expression syntax.
- Replace with
- Enter the text, along with any regular expressions characters, which you intend to use as a replacement for the matches to the text entered into the Find what text box. Select the drop-down list to display the last 16 items entered. Choose the wedge button to view a list of wildcard and regular expression syntax.
- Match case
- Searches only for occurrences that match the combination of uppercase and lowercase characters you enter in the Find what box and replaces the text with the combination of uppercase and lowercase characters you enter in the Replace with box.
- Match whole word
- Makes replacements for only whole words rather than text within words.
- Indicates that certain characters entered in the Replace with and Find what text boxes match text patterns. The exact interpretation depends on which pattern-matching syntax, either Wildcard or Regular Expressions, is selected from the drop-down list.
- Indicates that the use of certain characters in the Replace with and Find what text boxes represent a class of character or sequence of characters. For a complete list, see Wildcards.
- Regular expressions
- When selected, indicates that the use of certain characters in the Replace with and Find what text boxes represent notations for patterns of text rather than the literal character. For a complete list, see Regular Expressions.
- Keep modified files open after Replace All
- Leaves open all files that have had replacements made so you can verify the changes. Memory constraints might limit the number of files that can remain open after a replace operation.
Caution You can only use Undo for replacements made in files that remain open after the replacement operation.
- Look in
- Specifies the files or folder in which to make replacements. Type one or more directory or file names, separated by semicolons, to make replacements in or choose from the default scopes in the drop-down list; alternatively, create your own scope by clicking the Ellipses button. You can also select a pre-defined scope from the drop-down list. These scopes include Current Document, All Open Documents, All Searchable Items, Current Project, Visual C++ Include Directories, and Visual C++ Source Directories.
- Look in subfolders
- When selected, indicates that the replace operation includes files that are located in folders specified in the Look in drop-down list.
- File types
- Specifies the file extensions for the type of files to search in the directories listed in the Look in drop-down list. If no extensions are listed, all of the files in the directories listed in the Look in drop-down list are searched.
- Display in Find 2
- View the replacement summary in the Find Results 2 window rather than the default window, Find Results 1. Use this option to retain multiple replacement results.
- Replace all
- Replaces all matches from a search.
Caution Replace All applies to all matches for the search, including files you might have skipped while browsing through the search matches. You can only use Undo for replacements made in files that remain open after the replacement operation.
- Skip File
- Specifies that replace ignores the current file and continues on to the next file that contains matches.
Caution Replace All applies to all matches for the search, including files you skip using Skip File. You can only use Undo for replacements made in files that remain open after the replacement operation.