Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
^[^\s@]+@([\w\-]+\.)+[\w\-]{2,}$
/

Description

Very simple & basic. More forgiving, less stringent. Allows anything which looks reasonably valid. Allows one at-symbol. Requires a two part hostname (i.e. abc@localhost is not allowed)

Submitted by billinghamj - 10 years ago