pub const EMAIL: &str = r"([a-z0-9_+.]*)@([a-z0-9]+(?:[\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6})";
Expand description
Retrieves two capturing groups, one for username, the other for mail server and its domain.
ยงExamples
use easy_regex::{collection::*, EasyRegex};
let text = r#"something@email.co.uk"#;
let result = EasyRegex::new(EMAIL);
let captures = result.get_regex().unwrap();
captures.captures_iter(text).for_each(|caps| {
println!("{}, {}", &caps.get(1).unwrap().as_str(), &caps.get(2).unwrap().as_str());
})
// will print: something, email.co.uk