rust check valid email address using regex code example
Example: rust check valid email address using regex
use regex::Regex;
let email_regex = Regex::new(r"^([a-z0-9_+]([a-z0-9_+.]*[a-z0-9_+])?)@([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6})").unwrap();
println!(" is valid: {} ", email_regex.is_match("xyz"));
println!(" is valid: {} ", email_regex.is_match("[email protected]"));