re = /(?:[\.\d]+\,[\.\d]+\s*?){5,5}/
str = '<path d="M 15.43,29.45 C 23.73,28.89 38,25.96 44.2,25.42 46.48,25.22 47.41,27 47.16,29.29 46.59,34.67 45.5,46 44.14,53.63"/>
<path d="M 16.91,41.07 C 19.61,40.8 36.25,38.5 45.64,37.7"/>'
# 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