Skip to content

Instantly share code, notes, and snippets.

@asiellb
Forked from willnss/gist:1878806
Created September 6, 2021 16:24
Show Gist options
  • Save asiellb/81da8cbc67a6f00ff17cf79d33dffc8c to your computer and use it in GitHub Desktop.
Save asiellb/81da8cbc67a6f00ff17cf79d33dffc8c to your computer and use it in GitHub Desktop.
explained email regex
/\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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment