Skip to content

Instantly share code, notes, and snippets.

@argshook
Created May 5, 2014 16:49
Show Gist options
  • Select an option

  • Save argshook/c503b92882398a86da59 to your computer and use it in GitHub Desktop.

Select an option

Save argshook/c503b92882398a86da59 to your computer and use it in GitHub Desktop.

Revisions

  1. argshook created this gist May 5, 2014.
    3 changes: 3 additions & 0 deletions matchEmail.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    // regexp for matching a valid email and populating an array with its parts

    'email@domain.com'.match(/([a-z|0-9]{2,})+\@([a-z|0-9]+)\.(.{2,})/) // <= ['email@domain.com', 'email', 'domain', 'com']