DEV Community

Discussion on: Simple Email Validation in Javascript & CSS

Collapse
 
linehammer profile image
linehammer

The fully RFC 822 compliant regex is inefficient and obscure because of its length. Fortunately, RFC 822 was superseded twice and the current specification for email addresses is RFC 5322. RFC 5322 leads to a regex that can be understood if studied for a few minutes and is efficient enough for actual use.

If you use HTML5, use this code:

net-informations.com/js/progs/emai...