re = /failed:.*\,/mi
str = '{Client:100.96.43.15,ElapsedMilliseconds:214,EndTime:2019-10-02T20:18:56.027320,Failed:0,Name:MasterAddress,Results:[{ElapsedMilliseconds:213,EndTime:2019-10-02T20:18:56.027291,Result:{AddressTypeCode:STANDARD,ID:00A-27P-15Q,Municipality:{Name:Windsor,StateProvince:{Code:ON,Country:{Code:CA}}},PostalCode:{Value:N8S0A1},Street:{Name:McHugh,StreetType:{Abbreviation:{en:St,fr:St},Value:{en:Street,fr:Street}}},StreetNumber:8787},StartTime:2019-10-02T20:18:55.813313,Success:true}],Server:master-address-68bf54d578-vczph,StartTime:2019-10-02T20:18:55.813162,StatusCode:200,Succeeded:1,TimedOut:0,Version:1.0}
'
# 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