// 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)\w[\w-]*(?:\.\w[\w-]*)*@\w+\.(?:com|miami)").unwrap();
let string = "Jazmine Holcomb 3212 Adams Avenue Washington MD eluir.azevedo.7o@lucidmode.com
Sofie Hagan 4241 Jerry Dove Drive Erie PA zfraction00t@jfaccupuncture.com
Cairo Tyson 3768 Clifford Street San_Jose CA varifi.amin@disabilitylawyersatlanta.com
Tasmin Kearney 2956 Adams Drive El_Campo CA 1paul.clinssonq@aprilmovo.com
Aydin Moran 3727 Sarah Drive Lake_Charles LA 3egdol@blogspot.miami
Samirah Pollard 946 Douglas Dairy Road Prosperity SC rzekohahaha@gmailup.com
Jaskaran Wheeler 1521 Richards Avenue Torrance CA ardit.ditty@netfacc.com
Gerrard Browning 4690 Felosa Drive Los_Angeles CA cgbeshar@lotomoneymaker.com
Haleema Craft 73 Pinchalone Street Norfolk VA 0kjhdsxz123e@summitgg.com
Brett Neal 4079 Johnson Street Garner NC fali_gx2000w@plussmail.com";
// 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/