Regular Expressions 101

Community Patterns

Useful to match email addresses

0

Regular Expression
PCRE (PHP <7.3)

/
^(")(?<name>(.*))(") (<){0,1}(?<email>(?<full>(?<user>.*)@(?<host>(?<subdomain>.*\.)?((?<domain>.*?)\.(?<tld>[^>]+)))))(>?)$
/
i

Description

matches parts of an email address and captures elements into groups

Submitted by anonymous - 3 years ago