Reputation: 75
I'm trying to find lines in some text that does not contain 403
, between the BEGIN
and END
. I thought a negative lookahead would be the solution but can't seem to get it to work across multiple lines, this is what I thought might work:
BEGIN(?!403).*?END
This is the text to search across:
BEGIN
403
403
403
301
END
Expected result:
301
I can get it to work with the following, but I want to make it explicitly search only between BEGIN and END:
^((?!403|BEGIN|END).)*$
Upvotes: 2
Views: 166