In Visual Studio 2010, how do you search for text that is not within a single line comment? E. G. how to find \"bas\" in:
foo bar bas
but n
In the Visual Studio Find dialog, try using this regular expression (make sure to select Use: Regular expressions in the Find options):
~(//[.:b]*)
This should find all occurrences of the word bas
which are not preceded by //
.
Note that the Visual Studio regex syntax is a bit different than the conventional syntax. You can find the reference HERE.