// 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"(?ms)\b[AZQ]\d{10,14}(>\S+).*?(First Time : \d\d:\d\d[AP]M)").unwrap();
let string = "qitjfjdjqkfjjf 1934848[*{*}*}*#*#*#[#*
]*,qgvv]*?£[£?£,£~'_!~£[££<£<'<'?£]!<!<
['~£,'}'<',!']'',',<€~Z1234566789>Z12345667890
1'fncnr'qmtjcsmsj194&($.!:!
,$/&15?'?'(''(('(''158,$3,!!1
1'('(',';?1!( First Time : 10:10PM
1&4$,!;($qmfjccn1'fkfkckcqtngcnnq
AAABBB : ,$2$$(&158((&&,&,&;&(&&((&
qitjfjdjqkfjjf 1934848[*{*}*}*#*#*#[#*
]*,€]*?£[£?£,£~'_!~£[££<£<'<'?£]!<!<
['~£,'}'<',!']'',',<€~A1234566789>A1234566789123
1'fncnr'qmtjcsmsj194&($.!:!
,$/&15?'?'(''(('(''158,$3,!!1
1'('(',';?1!( First Time : 10:10PM
1&4$,!;($qmfjccn1'fkfkckcqtngcnnq
AAABBB : :&;&;&(&;'1(&?&,&,&1&(&(,
$2$$(&158((&&,&,&;&(&&((&;&;&;&;&
qitjfjdjqkfjjf 1934848[*{*}*}*#*#*#[#*
]*,€]*?£[£?£,£~'_!~£[££<£<'<'?£]!<!<
['~£,'}'<',!']'',',cjejfnfn<€~Q1234566789>Q123456678912
1'fncnr'qmtjcsmsj194&($.!:!
,$/&15?'?'(''(('(''158,$3,!!1
1'('(',';?1!( First Time : 10:10PM
1&4$,!;($qmfjccn1'fkfkckcqtngcnnq
dbxbxne AAABBB : ,$2$$(&158((&&,&,&;&(&&((&";
// 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/