Community Patterns

Community Library Entry

1

Regular Expression
Created·2023-06-20 02:25
Updated·2023-06-20 02:48
Flavor·PCRE2 (PHP)

/
^(\w+[._%+-]*)+@(([a-zA-Z0--ÿ-]+-?)+\.)+[a-zA-Z]{2,}$
/
gm
Open regex in editor

Description

This regex will validate pretty much every mail that could exist. It allows aliases and tags in the mail, therefore the mail can contain one or more dots and/or "+" signs (Exemple: exemple.test.alias+tag+tag2). It also allows Internationalized Domain Names (IDNs) (Exemple: @café.com), subdomains (Exemple: domain.subdomain.com) and also "multiple" Top-Level Domain (Exemple: .com or .co.uk)

Submitted by Skyle