re = /(?m)^(?!.*\b(?:invokername=server|bantime)\b).*2015-07-08.*client disconnected.*invokername=.*$/
str = '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\'
'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html