Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(?:[\p{L}\p{M}\p{N}!#$%&'*+/=?^`{|}~-]|[\p{L}\p{M}\p{N}!#$%&'*+/=?^`{|}~-](?:[\p{L}\p{M}\p{N}!#$%&'*+/=?^`{|}~-]|\.(?!\.)){0,62}[\p{L}\p{M}\p{N}!#$%&'*+/=?^`{|}~-])@(?:[\p{L}\p{M}\p{N}]|[\p{L}\p{M}\p{N}][\p{L}\p{M}\p{N}_-]{0,61}[\p{L}\p{M}\p{N}])(?:\.(?:[\p{L}\p{M}\p{N}]|[\p{L}\p{M}\p{N}][\p{L}\p{M}\p{N}_-]{0,61}[\p{L}\p{M}\p{N}]))+\.?$
/
umg

Description

Only meant as an initial client-side filter to override the default input[type=email] validation done according to spec, which is much too simple.

Inputs passing this regex MUST get validated in a more fine-grained manner again when received on the server-side

Submitted by Neel Yadav - 2 years ago (Last modified 2 years ago)