// 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)(.+) (HC|PO|bbt|bty|bjx|prs|bag|gls|nst|resort|shs|cts|atm|bls|gls|jck|clp|fsh|glv|bck|blt|drs|sle|hts|emn|ham|pre fall|str|pnt|skr|mat|m PO|bks|m |PreFall|Resort|brd|LO|AR|sok|F |S )|.+").unwrap();
let string = "London str F20 212.jpg London
Luisa Spagnoli bbt S22 048.jpg Luisa Spagnoli
Marco Rambaldi bjx S22 006.jpg Marco Rambaldi
Max Mara bag S22 002.jpg Max Mara";
// 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/