The find and replace window allows you to carry out text search and replacement in the current document or in a range of specified files.
To open the find and replace window
- From Search menu, click Find and Replace.
—or—
- Type Ctrl+Alt+F.
To find text in a single file
- Select the
Find button on the tool bar.
- Enter the string to be found in the Find what input.
- If the search will be case sensitive, set the Match case option.
- If the search will be for a whole word, i.e. there will be whitespace, the beginning or the end of line on either side of the string being searched for, set the Match whole word option.
- If the search string is a Regular Expression, set the Use regular expression option.
- Click the Find Next button to find next occurrence of the string or click Bookmark All to bookmark all lines in the file containing the string.
To find and replace text in a single file
- Select the
Replace button on the tool bar.
- Enter the string to be found in the Find what input.
- Enter the string to replace the found string with in the Replace with input. If the search string is a Regular Expression then the \n backreference can be used in the replace string to reference captured text.
- If the search will be case sensitive, set the Match case option.
- If the search will be for a whole word, i.e. there will be whitespace, the beginning or the end of line on either side of the string being searched for, set the Match whole word option.
- If the search string is a Regular Expression, set the Use regular expression option.
- Click the Find Next button to find next occurrence of string and then Replace button to replace the found string with replacement string or click Replace All to replace all occurrences of the string without prompting.
To find text in multiple files
- Select the
Find In Files button on the tool bar.
- Enter the string to be found in the Find what input.
- Select whether you want to carry out the search in all the open documents, all the documents contained in the current project, all the documents in the current solution or all the files in a specified folder by selecting the appropriate option in the Look in input.
- If you have specified that you want to search in a specified folder select the folder you want to search in by entering the path in the Folder input and specify the type of files you want to search using the Look in files matching input.
- If the search will be case sensitive, set the Match case option.
- If the search will be for a whole word, i.e. there will be whitespace, the beginning or the end of line on either side of the string being searched for, set the Match whole word option.
- If the search string is a Regular Expression, set the Use regular expression option.
- Click the Find All button to find all the occurances of the string in the specified files or click the Bookmark All button to bookmark all the occurances of the string in the specified files.
To replace text in multiple files
- Select the
Replace In Files button on the tool bar.
- Enter the string to be found in the Find what input.
- Enter the string to replace the found string with in the Replace with input. If the search string is a Regular Expression then the \n backreference can be used in the replace string to reference captured text.
- Select whether you want to carry out the search and replace in all the open documents, all the documents contained in the current project, all the documents in the current solution or all the files in a specified folder by selecting the appropriate option in the Look in input.
- If you have specified that you want to search in a specified folder select the folder you want to search in by entering the path in the Folder input and specify the type of files you want to search using the Look in files matching input.
- If the search will be case sensitive, set the Match case option.
- If the search will be for a whole word, i.e. there will be whitespace, the beginning or the end of line on either side of the string being searched for, set the Match whole word option.
- If the search string is a Regular Expression, set the Use regular expression option.
- Click the Replace All button to replace all the occurances of the string in the specified files.