// 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"(?mi)(MB_PKW|MB_VAN|MB_LKW|Omnibus)\/xports\/QL\/QL_AS_(.+?)\.xml").unwrap();
let string = "/Omnibus/xports/EDAS/EvoBus_ABS02T.edas.xml
/MB_VAN/xports/EDAS/VAN_AIRBAG470.edas.xml
/MB_LKW/xports/edas/LKW_VRDU01T.edas.xml
/MB_PKW/xports/EDAS/PKW_ADAS_GW453.edas.xml
/MB_VAN/xports/QL/QL_AS_CONNECT907.xml
";
// 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/