re = /\$\d{3,}\.\d{2}/m
str = '1001: $496.80
1002: $1290.89
1003: $26.43
1004: 613.42
1005: 7.61
1006: $414.90
1007: $25.00'
# 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