Validate an email address in JavaScript
Published on Jan 26, 2020
This is my least favorite topic; validating email addresses. There are hundreds of examples using regular expressions that are all slightly different and all have there own quirks with them.
If validation must be done, I suggest only doing this on the client-side. Ideally the server-side performs email validation by sending an actual email that includes a unique link to validate the email is valid.
But if JavaScript is a must, here is the best one I've found.