// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"(?m).*Queue=([^\,].*),.*").unwrap();
let string = "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 }";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
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 Rust, please visit: https://docs.rs/regex/latest/regex/