Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-04-18 16:16
Flavor·PCRE (Legacy)

/
(([A-Za-z0-9]+\w*[\.\-]?){1,}+\w*@([A-Za-z0-9]+\.){1,2}[A-z]{2,3})
/
g
Open regex in editor

Description

Validates most email addresses. Using the range [A-Za-z0-9] at the beginning instead of \w means an address cannot begin with an underscore. This range is also used to exclude underscores from the domain (part after @).

Submitted by Owen Howard