Answers for "rust check valid email address using regex"

0

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]"));
Posted by: Guest on February-22-2021

Code answers related to "rust check valid email address using regex"

Browse Popular Code Answers by Language