DEV Community

how to validate email with special characters |, :, &?

Suhana on September 29, 2022

I have a regex ^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$. Now i want to allow all special characters(|,&,:) in it with out changing whole regex

thanks in advance

Collapse
 
yashu_07 profile image
Alluri Yashwanth

@suhana , what to understand more on this like which email domain allows these as the email Ids?

But you can try with this Regex :-
^\w+([\$-|])@\w+([.-]?\w+)(.\w{2,3})+$