开发者

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...

  1. MyClassSetupEngine
  2. MyClassExecuteEngine
  3. MyClassDatalog

but not the specific string

  1. 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?]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜