Reputation: 329
I have a regex matching a line having the word "Mq\w+GetContext"…
^.*Mq\w+GetContext.*$
example: MqBufferGetContext, MqDumpGetContext, MqErrorGetContext etc
and NOW my problem… I dont't want to have the line matching the word…
MqErrorGetContext
try to use
^.*Mq(?!Error)GetContext.*$
does not work.
Upvotes: 0
Views: 22
Reputation: 163362
You might use a negative lookahead (?!
if it is supported to assert that MqErrorGetContext
is not present.
You could use a word boundary \b
for it not be part of a longer match.
^(?!.*\bMqErrorGetContext\b).*Mq\w+GetContext.*$
Upvotes: 2