Regex matching multiple negative lookahead
Lookahead (?=foo)
, (?!foo)
and lookbehind (?<=foo)
, (?<!foo)
do not consume any characters.
You can do multiple assertions:
^(?!abc:)(?!defg:)
or:
^(?!defg:)(?!abc:)
...and the order does not make a difference.
Try doing this :
^(?!(?:abc|defg):)