// 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)(?:(?P<Date>(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2}, \d+ \d{1,2}:\d{1,2} AM|PM) (?P<WarnID>(?:[0-9a-f]|-)*) (?P<User>[a-zA-Z]+#[0-9]{4}) (?:\((?P<UserID>[0-9]+)\)) (?P<Moderator>[a-zA-Z]+#[0-9]{4}) (?P<WarnReason>(?:\s|\S)+))").unwrap();
let string = "Fri, Apr 21, 2023 7:49 AM 6ab4e8de-262b-4926-a12e-646863749f35 Fir#7634 (750565290009559112) HitByaThunder#1925 continuing to make giveaways after being told to stop. fir, stop if you're asked to Stop";
// 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/