Skip to content

Instantly share code, notes, and snippets.

@foxbunny
Created March 8, 2019 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foxbunny/b423818c662ebaee44fbe45eae4de40f to your computer and use it in GitHub Desktop.
Save foxbunny/b423818c662ebaee44fbe45eae4de40f to your computer and use it in GitHub Desktop.
Reasonably good regexp library
const emailRe = /^([\w\d\-+](\.?[\w\d_\-+])*)@(((2([0-4]\d|5[0-5])|1?\d{1,2})\.){3}(2([0-4]\d|5[0-5])|1?\d{1,2})|[a-z\d]([a-z\d-]{1,61}[a-z\d])?(?:\.[a-z]{2,})+)$/
// Able to pass the test samples here: https://blogs.msdn.microsoft.com/testing123/2009/02/06/email-address-test-cases/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment