re = /"([\d\-\:\.]+)":{"value":"?([\d]+)"?/m
str = '{"0-0:96.1.1":{"value":"54978381"},"0-0:1.0.0":{"value":0,"time":1696963760},"1-0:1.8.0":{"value":743,"time":1696963760},"1-0:2.8.0":{"value":0,"time":1696963760},"1-0:3.8.0":{"value":0,"time":1696963760},"1-0:4.8.0":{"value":203,"time":1696963760},"1-0:1.7.0":{"value":303443.1,"time":1696963760},"1-0:2.7.0":{"value":612.3,"time":1696963760},"1-0:3.7.0":{"value":541.3,"time":1696963760},"1-0:4.7.0":{"value":140247.8,"time":1696963760},"0-0:2.0.0":{"value":1653,"time":0},"api_version":"v1","name":"54978381","sma_time":8291.3}'
# 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