// 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)M[rs].\s[A-Z]\w+(?:\s[A-Z]\w+(?:\s\([^\)]*\))?)?").unwrap();
let string = "21. The SBSTA considered this agenda item at its 1^st^ meeting and resumed 3^rd^ meeting, on 15 November. It had before it document FCCC/SB/2016/3. At its 1^st^ meeting, the SBSTA agreed to consider this agenda item together with agenda item 11 of the SBI in informal consultations co-facilitated by Ms. Beth Lavender (Canada) and Mr. Alf Wills (South Africa). As referred to by the COP,[^18] the SBSTA also considered the issue of the review of the Warsaw International Mechanism for Loss and Damage associated with Climate Change Impacts, and agreed that it would be discussed at the same informal consultations. At its resumed 3^rd^ meeting, the SBSTA recommended two draft decisions on these matters for consideration and adoption at COP 22.[^19]. Mr. Seen and Mr. Conwell participate actively to the reconciliation.
";
// 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/