// 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)(\d{6}\_\d{9})\=.*(gurlan,danu)").unwrap();
let string = "[7384] [Birthdays]
[7384] 180528_201747263=198202141300
[7384] 180528_210749326=19840222
[7384] 180528_211723352=19831207
[7384] 180528_211845500=201607072350
[7384] 180528_212024116=19591231
[7384] 180528_212038465=19590323
[7384] 180528_213357273=19590811
[7384] 180528_213701342=19780608
[7384]
[7384] [NameSurname]
[7384] 180528_201747263=Gurlan V. Vasile aka. Licuta
[7384] 180528_210749326=Gurlan (Enea) V. Maria aka Mariana
[7384] 180528_211723352=Danu (Gurlan) F. Oana Nicoleta aka. Nikol
[7384] 180528_211845500=Gurlan V. Rebecca-Ioana
[7384] 180528_212024116=Gurlan P. Vasile
[7384] 180528_212038465=Nucu (Gurlan) N. Maria
[7384] 180528_213357273=Bogdan (Danu) G. Elena
[7384] 180528_213701342=Enea D. Ioan Dorin
";
// 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/