Skip to content

Instantly share code, notes, and snippets.

@gdog2u
Created April 12, 2019 20:26
Show Gist options
  • Save gdog2u/b0326d533d91865bb5813e8d64044991 to your computer and use it in GitHub Desktop.
Save gdog2u/b0326d533d91865bb5813e8d64044991 to your computer and use it in GitHub Desktop.
Email Regex
^(?:[a-zA-Z0-9!#$%&'*+\-\/\=?^_`{|}~]|\.(?!\.)){1,64}@(?:(?:[a-zA-Z0-9\-]){1,63}\.(?!\.)){1,4}(?:[a-zA-Z0-9]{2,12})$
@gdog2u
Copy link
Author

gdog2u commented Apr 12, 2019

Matches the following email schemes,

username@gmail.com
very.common@example.com
user.name@my.college.edu
disposable.style.email.with+symbol@example.com
other.email-with-dash@example.com
fully-qualified-domain@example.com
user.name+tag+sorting@example.com
x@example.com
other.country@company.net.jp

Special character group borrowed from https://en.wikipedia.org/wiki/Email_address#Syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment