re = /.*Queue=([^\,].*),.*/m
str = 'ext:tech.IBMMQ_Java.Queue.Depth: { Queue=ATDX01M2.CSV.NOTIFICATIONS_FROM_SYSTEM, dt.entity.custom_device=CUSTOM_DEVICE-C43C30B0FE89F372 }
ext:tech.IBMMQ_Java.Queue.Depth: { Queue=ATDX44M2.CDS.ABC.REQUESTQ, dt.entity.custom_device=CUSTOM_DEVICE-C4D1C6E4782764FB }
ext:tech.IBMMQ_Java.Queue.Depth: { Queue=ATDX01M1.CSV.ESB.ABC.XYZ_MESSAGES, dt.entity.custom_device=CUSTOM_DEVICE-57183614D438F39E }'
# 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