Is it possible to write a regexp rule in "one line" that says: neither A nor B.
For example:
String must contain NEITHER "foo" NOR "bar".
Why one line? Because the filtering tool I am using accepts only one line ... I have tried things like (.*foo.*){0}(.*bar.*){0}
without enough luck.
(?!REGEX_1)REGEX_2
will fail ifREGEX_1
matches, but won't consume any characters so that matching ofREGEX_2
will start at the same position. There is positive look-ahead(?=REGEX_1)REGEX_2
and their look-behind counter parts. Read regular-expressions.info/lookaround.html – Monocular