How to use Visual Studio "Find in Files" tool window to find ALL lines having a certain phrase in them but filter by NON-comment lines at the same time?
There must be a regular expression? Or a link to the regexp help?
Ctrl+K+U will uncomment the code.
Once installed, remove comments in your code by opening the command palette ( Ctrl + Shift + P ), entering "Remove all comments" and pressing enter. Voilà , all the comments are gone 🎉 !
Select "Use Regular Expressions" in the "Find in Files" window and enter the following phrase in the search box:
^(?!(\s*/+)).*phrase
If you want the phrase to stay as a single word:
^(?!(\s*/+)).*\s+phrase\s+
Regarding the help: in regexp mode there is a small button next to the search box: [(a)+] It opens a short list with common regexp commands. At the end of that list there is a link to the msdn documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With