re = /^(.+?) - (.*)/
str = '2016-12-08 10:09:16 - [ERROR] - from application -
! @72aki4439 - Internal server error, for (POST) [/rest/v1/item] ->
play.api.Application$$anon$1: Execution exception[[NullPointerException: null]]
at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.11-2.3.8.jar:2.3.8]
at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.11-2.3.8.jar:2.3.8]
Caused by: java.lang.NullPointerException: null
at controllers.RestItem$2.apply(RestItem.java:577) ~[bla-1.0.jar:1.0]'
# Print the match result
str.match(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