Skip to content

Instantly share code, notes, and snippets.

@diskshima
Created September 25, 2016 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diskshima/9a197cd9eef8be084179db6a77a7c31a to your computer and use it in GitHub Desktop.
Save diskshima/9a197cd9eef8be084179db6a77a7c31a to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
str = 'I, [2014-09-04T05:17:29.385333 #19220] INFO -- : Parameters: {"users"=>{"profile_url"=>"https://example.com/users/123", "status"=>"1"}}'
matches = /[DIWE], \[([0-9\-T:\.]+).* Parameters: ({.*)/.match(str)
matches.to_a.each_with_index do |m, index|
puts "#{index}: #{m}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment