n H
n H

Reputation: 61

Search Sth in VS2012 that is not commented

I want to find all _0 in my code in VS 2012 Environment, but not in comments :(

Is there a way to delete all comments? (ofcourse just for search and find _0)

Upvotes: 0

Views: 50

Answers (1)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239764

If you're happy to only not match within single-line comments, then a regular expression with a negative lookbehind can be used:

(?<!//.*)_0

That is, it matches any occurrence of _0, provided that there isn't a // (followed by any number of characters) before it.

Upvotes: 1

Related Questions