Regular Expressions 101

Community Patterns

Community Library Entry

-2

Regular Expression
ECMAScript (JavaScript)

/
^\w+([-+.']\w+)*@\w+([-.]\w+)*\.[A-Z0-9]{2,6}([-.][A-Z0-9]{2,6})*$
/
i

Description

Use this Regex for server-side validation also with some slight modifications like so for .NET --

@\w+([-+.']\w+)@\w+([-.]\w+).[a-zA-Z0-9]{2,6}([-.][a-zA-Z0-9]{2,6})*;

Submitted by Fred Scales - 9 years ago