Using Visual Studio 2013, how would I find all occurrences of Sheet but not if it is MVC.Sheet?
I cannot figure out look behind.
This works to find ones that are not followed by .Index: Sheet(?!.Index)
Lookbehind has the same effect, but works backwards. It tells the regex engine to temporarily step backwards in the string, to check if the text inside the lookbehind can be matched there.
Negative lookahead That's a number \d+ , NOT followed by € . For that, a negative lookahead can be applied. The syntax is: X(?! Y) , it means "search X , but only if not followed by Y ".
A negative lookbehind assertion asserts true if the pattern inside the lookbehind is not matched.
JavaScript doesn't support any lookbehind, but it can support lookaheads.
Working in VS2013 (see screenshot):
(?<!MVC\.)Sheet
(?<!MVC\.)
lookbehind asserts that what precedesis not MVC.
Sheet
matches Sheet
Reference
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