Visual Studio 2012: All about the Quick Find and Replace Feature
This is the first post of a 30 post series that covers futures in Visual Studio 2012 and TFS 2012. Posts will range from beginner to advance level.
In this post I will try to cover everything you can do with the Find/Find and Replace feature in Visual Studio. I will be using Visual Studio 2012 in my examples.
We can launch the Quick Find box by either the Ctrl+F keyboard shortcut or click on Edit —> Find and Replace –> Quick Find. The quick find feature, highlights the text or expression you are trying to find
The following window shows up on top right corner of the opened document. The next bullets explains each label section do
1. The textbox where you type the word or the expression you are trying to find
2. Match case: It means if you are trying to ABC, you won’t find abc or Abc within the results
3. Match whole word: If selected, text or expression will be match against words. For instance, lets say you are looking for BC. ABCD, BCD, ABC, …etc will not be within your results.
4. Use regular expression: when selected, you can search using regular expression syntax. For example, I want to find the numbers between 0 and 9 and at the same time I want to find all text the contains the word “status”. I can use the following regex “[0-9]|status” without the quotes, and the text will be highlighted
5. Drop down to specify the scope of the search.
6. Toggle between Find and Find and Replace modes.
Note, if no matches found, the border of textbox becomes red
To replace matched text
1. Click on the “Toggle between Find and Find and Replace modes”, point number 6 above
2. I am going to replace the a typo I had in my code; replace the word Statsu with Status
3. Click the “a” button if you want to replace the next occurrence of the matched text
4. Click the “b” button if you want to replace all occurrences of the matched text in the selected scope (Current Document, project, solution …etc)
Next Post will be about the Find in Files feature