Skip to content

Instantly share code, notes, and snippets.

@argshook
Created May 5, 2014 16:49
Show Gist options
  • Save argshook/c503b92882398a86da59 to your computer and use it in GitHub Desktop.
Save argshook/c503b92882398a86da59 to your computer and use it in GitHub Desktop.
regexp for matching a valid email and populating an array with its parts
// regexp for matching a valid email and populating an array with its parts
'[email protected]'.match(/([a-z|0-9]{2,})+\@([a-z|0-9]+)\.(.{2,})/) // <= ['[email protected]', 'email', 'domain', 'com']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment