Regular expression literal
3 answers
In general, if you want a regex to match anything other than a specific string or pattern, it is almost always easier to transform the meaning of the test. So instead of "heres a pattern that I hope matches anything other than XYZ", check if XYZ matches and throws positive results.
If you only want those three then use
$ egrep '(NullPointer | Boo | Abc123) Exception' input.log
You might be successful with a two-stage conveyor, for example
$ grep Exception input.log | grep -v LoginException
+2
a source to share
You can use negative lookahead :
(?!Login)\b\w+Exception
You can do this with Perl, for example:
perl -ne 'print if /(?!Login)\b\w+Exception/' < mylog.log
+2
a source to share