I have the following regex which I obtained Regular expression to parse a log file and find stacktraces
^.+Exception[^\n]++(\s+at .++)+
It works great to find stack traces. However, I need to find stack traces that are outputted through a logger (in a Bukkit Minecraft server, specifically). They look like this:
2012-08-10 08:19:17 [SEVERE] java.lang.NullPointerException
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.World.tickEntities(World.java:1146)
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:567)
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212)
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:476)
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
The date and times will always change, but the [SEVERE] will always be there. I'm looking to capture that format of exception with a regular expression. Any Exception, not just an NPE.
I'm really not sure how to go about this. I checked out some tutorials on regex but these bigs ones are all gibberish to me still. This is my most recent attempt
^.+Exception[^\n]++(.++at .++)+
Edit:
Okay, I did some more research and got a little further. I made this:
\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s\[SEVERE\]
Which matches the first part. I'm having some trouble capturing the entire trace though.