I designed the regex to match the exception message field.
^.*\s([^:,\s]+):\s+([^:]+)\sat\s+\S+\((\w+)\.\w+:(\d+)\)$
It matches only few fields.
Test Strings is :
ERROR java.lang.NullPointerException: Sample Java Logback Exception
at Sample.errorLevel3(Sample.java:35)
at Sample.errorLevel4(Sample.java:34)
at Sample.errorLevel5(Sample.java:30)
at Sample.errorLevel6(Sample.java:3)
Matches found :
java.lang.NullPointerException
Sample Java Logback Exception
Sample
35
Expected Match :
java.lang.NullPointerException
Sample Java Logback Exception
Sample.errorLevel3
Sample.java
35
Sample.errorLevel4
Sample.java
34
Sample.errorLevel5
Sample.java
30
Sample.errorLevel6
Sample.java
3
Anyone have better regex for matching fields of Exception Message?