Reputation: 507
I was trying to search for ".IsSet", but not "DocumentState.IsSet", in VS 2008 using regular expression search. How do I compose the regular expression?
Thanks!
Upvotes: 2
Views: 1026
Reputation: 98011
~(DocumentState)\.IsSet
will match all .IsSet
instances that do not follow DocumentState
. To match exactly .IsSet
but not .IsSetFoo
, you can either use
~(DocumentState)\.IsSet>
or check the Match whole word option.
See Regular Expressions (Visual Studio) for a list of regular expression tokens supported in the Visual Studio search.
Upvotes: 1
Reputation: 7475
I don't know if you can with the VS Search, but you can
Upvotes: 0
Reputation: 192627
Try
(?!<DocumentState)\.IsSet
The ?!< is a "negative lookbehind".
Upvotes: 2