I am trying this regex
(?<!(John|Joe)) (Taylor)
On this text
John James Taylor
but I am getting “invalid pattern in lookbehind” here http://www.rubular.com/r/TjD2d4oG5z
I am trying to match “Taylor” that does not have John or Joe before it.
Any tips please?
Try the following:
(?:)is a non-capturing group, which makes sense in a lookaround, since you are merely doing an assertion, not actually matching anything. Or just remove the capturing group all together, that is,(?<!John|Joe).