re = /(\w+)/
str = '"1 2013-07-25 11599" CLOSED
"2 2013-07-25 256" PENDING_PAYMENT
"3 2013-07-25 12111" COMPLETE
"4 2013-07-25 8827" CLOSED
"5 2013-07-25 11318" COMPLETE
"6 2013-07-25 7130" COMPLETE
"7 2013-07-25 4530" COMPLETE
"8 2013-07-25 2911" PROCESSING
"9 2013-07-25 5657" PENDING_PAYMENT
"10 2013-07-25 5648" PENDING_PAYMENT
"11 2013-07-25 918" PAYMENT_REVIEW
"12 2013-07-25 1837" CLOSED
'
# 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