I have a problem with creating a regex, and I searched for 2 days around Google, stack overflow and other documents ...
I have the following lines:
2015-07-08 12:49:07.183852|INFO |VirtualServerBase| 3| client disconnected 'Ròem'(id:6336) reason 'invokerid=20 invokername=Alphonse invokeruid=loremipsum2= reasonmsg=test'
2015-07-08 11:59:23.178055|INFO |VirtualServerBase| 3| client disconnected 'Trakiyen'(id:20460) reason 'invokerid=0 invokername=server reasonmsg=idle time exceeded'
2015-07-08 12:40:50.591450|INFO |VirtualServerBase| 3| client disconnected 'kalash'(id:20464) reason 'invokerid=136 invokername=Charles invokeruid=loremipsum= reasonmsg=Aller, Bisous! bantime=0
2015-07-08 00:23:03.235312|INFO |VirtualServerBase| 3| client disconnected 'Brigata FTW'(id:20451) reason 'invokerid=103 invokername=Bob invokeruid=loremipsum3= reasonmsg=En vous souhaitant une bonne soirée <3 bantime=28800'
I want to combine only the first line, following these conditions:
- No line with
invokername=server - No line with
bantime
In this case, the result should match only the first line with the following regular expression:
.*2015-07-08.*client disconnected.*invokername=[^server].*[^bantime=].*
I write only one regular expression, but I have tried many, many different things (s ?!, etc.). I read a lot of topics about Stack Overflow exception, but couldn't find a solution. Hope someone helps me.
source
share