It is a mistake to make mistakes in false statements. If you want to use lookahead, the template looks something like this:
^(?!.*paragraph$).*$
This matches ( as seen on rubular.com ):
something something para paragraph something something
But does not match:
something paragraph
So, the main difference is that we start looking forward at the beginning of the line before we match .* (Or .{0,1000} in your case). Of course, what we're looking for is not just paragraph$ , but rather .*paragraph$ .
However, to verify that the string does not end with something of finite length, lookbehind, when supported, is the most natural solution.
^.*$(?<!paragraph)
source share