DEV Community

Suhana
Suhana

Posted on

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

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

Top comments (1)

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})+$