re = /(?<=[A-Za-z]\d:)\w+(?=\D+ )/m
str = '08:27:08,946 INFO [com.cars.bdlx.manageinvoice.common.ManageInvoiceService-170] (http-/0.0.0.0:8080-22) REQUEST:V4:dUowlr45NG88:GET_INVOICE_PDF InvoicePdfRequest[customerID=12345678,accountNumber=987654321,invoiceNumber=33333333,countryCode=UK,page=<null>,pageFrom=<null>,pageTo=<null>,copy=false,billingSystemID=MOB,date=<null>,brand=TIGER,callingSystem=Base,userId=777777777,additionalRights=<null>]
08:27:08,244 INFO [TIME-460] (http-/0.0.0.0:8080-7) TIME:V4:YpXGo1j4dMcS:GET_INVOICE_PDF:0.048
'
# 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