Regular Expressions 101

Community Patterns

Disorted Email Addresses

51

Regular Expression
PCRE (PHP <7.3)

/
^(?'Username'[-\w\d\.]+?)(?:\s+at\s+|\s*@\s*|\s*(?:[\[\]@]){3}\s*)(?'Domain'[-\w\d\.]*?)\s*(?:dot|\.|(?:[\[\]dot\.]){3,5})\s*(?'TLD'\w+)$
/
gm

Description

Matches distorted email addresses and converts them back to real ones.

Submitted by dislick - 11 years ago