DEV Community

Discussion on: How to validate an email address in JavaScript

deceze profile image
David Zentgraf

Email addresses do in fact allow spaces in the local part. Your regex leads to false negatives. See 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.