// 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)[^&]_*\s*(SF)*\d{8}").unwrap();
let string = "_zz&69050398_5d147597dd4aca00014351d9_zz sf 76064603RPL_Import_Create
_zm&69396284_5d165ed60198d60001fbef9a_75946292_Import
_aa&69385775_5d15782bdd4aca0001435432_supplier_info_import_template
_aa&68936210_5d16581add4aca00014355e9_76005473 RPL_Import_Create_Stand_to_Package
_ac&68728692_5d18fa52dd4aca00014356dd_SF 76113839 Copy of Generic_Export_AdvancePR_result - 2019-06-30T200450.090";
// 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/