Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

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("foo@bar.com"));
 
PREVIOUS NEXT
Tagged: #rust #check #valid #email #address #regex
ADD COMMENT
Topic
Name
9+3 =