Regular Expressions 101

Community Patterns

1...34567...900

Community Library Entry

52

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 - 12 years ago