Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-08-26 11:55
Flavor·PCRE (Legacy)

/
(?(DEFINE) (?<plain>[a-zA-Z0-9#!$%&'*+-\/=?^_`{}|~]+) (?<quote>"(?:\\"|[^"])*") (?<forbidden>(?<![.+])) (?<local_part>(?&quote)(?&forbidden)|^[^\.](?&plain)) (?<domain>[a-zA-Z0-9-.]+\.[a-zA-Z]{2,63}) (?<mail>(?&local_part)@(?&domain)) ) ^(?&mail)+$#.. will not handled
/
mx
Open regex in editor

Description

Pattern matches mails in a single line with right syntax. Exceptions double dots in mail (..) will not handled.

Submitted by Martin