I'm working on a contact form, in the email input field I need to make sure that the user is inputting a correct email address.
I've only found regex that validate the below:
email@domain
(without the .com
,.net
, .info
, etc)
What regex requires the user to enter the .com
, .net
, etc?
Regex I've used:
\b[A-Z0-9._%+-]+@@[A-Z0-9.-]+\.[A-Z]{2,6}\b
^[A-Z0-9][A-Z0-9._%+-]{0,63}@@(?:(?=[A-Z0-9-]{1,63}\.)[A-Z0-9]+(?:-[A-Z0-9]+)*\.){1,8}[A-Z]{2,63}$
^(?=[A-Z0-9@@._%+-]{6,254}$)[A-Z0-9._%+-]{1,64}@@(?:[A-Z0-9-]{1,63}\.){1,8}[A-Z]{2,63}$
^[A-Z0-9._%+-]{1,64}@@(?:[A-Z0-9-]{1,63}\.){1,125}[A-Z]{2,63}$