I'm trying to match a string (using a Perl regex) only if it doesn't start with "abc:" or "defg:", but I can't seem to find out how. I've tried something like
^(?:(?!abc:)|(?!defg:))
I'm trying to match a string (using a Perl regex) only if it doesn't start with "abc:" or "defg:", but I can't seem to find out how. I've tried something like
^(?:(?!abc:)|(?!defg:))
This will do the task :
Try doing this :
… or could have dropped the alternation from the original expression:
^(?!abc:|defg:)\s*\w+
use this regex. this will avoid line start with "abc:" and "defg:" as you want.
Try this.See demo.
http://regex101.com/r/hQ9xT1/18
Could you please try this: