DEV Community

Discussion on: How to validate an email address in JavaScript

Collapse
 
deceze profile image
David Zentgraf

Email addresses do in fact allow spaces in the local part. Your regex leads to false negatives. See en.wikipedia.org/wiki/Email_addres.... Though practically speaking you will probably never encounter emails which use this advanced syntax, precisely because developers implement regexen like this which lead to false negatives and make such addresses unusable.