re = /(?<!\.)(\b(?:\d{2,3}|[2-9])(?:\.\d+)?\b|\b1\.(?:1\d?|0[1-9])\b)(?!%|\.)/m
str = '0.32 100.00 5.6 0.27 98% 12.2% 1.01 0.99% 0.99 13.13 1.10'
# 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