re = /Measurement\=\"(?<Measurement_0>[^,]*),(?<Measurement_1>[^,]*),(?<Measurement_3>[^,]*),(?<Measurement_4>[^,]*),(?<Measurement_5>[^,]*),(?<Measurement_6>[^,]*),(?<Measurement_7>[^,]*),(?<Measurement_8>[^,]*),(?<Measurement_9>[^,]*),(?<Measurement_10>[^,]*)/
str = ' 2017-10-18 16:59:30.943, MetaDataFoo="ValueFoo", Event_Time="2017-10-18 16:59:30.943", Measurement="45.89502,44.895,44.99505,44.89502,44.89502,45.42877,45.96756,46.09344,46.22437,46.315"'
# 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