RegExp to find a specific string not ending with a specific word
I am trying to figure out a RegExp to match the following strings...
- MyClassSetupEngine
- MyClassExecuteEngine
- MyClassDatalog
but not the specific string
- MyClassSetup
Notice the string #1 includes the string #4 but #1 should be found by the RegExp while #4 should not.
I tried the following (with no success so far):
MyClass(^(Setup).+)
MyClass(?!(Setup).+)
EDIT I'm using C++ with boost 开发者_StackOverflow社区regexp 1.35.0
Try:
MyClass(?!(Setup$)).+
The dollar sign signifies the end of the string.
[Note, this works for Javascript - what language are you using?]
精彩评论