Skip to content

Instantly share code, notes, and snippets.

@willnss
Created February 21, 2012 20:43

Revisions

  1. willnss revised this gist Feb 21, 2012. No changes.
  2. willnss created this gist Feb 21, 2012.
    11 changes: 11 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i full regex
    / start of regex
    \A atch start of a string
    [\w+\-.]+ at least one word character, plus, hyphen, or dot
    @ literal “at sign”
    [a-z\d\-.]+ at least one letter, digit, hyphen, or dot
    \. literal dot
    [a-z]+ at least one letter
    \z match end of a string
    / end of regex
    i case insensitive