Regular Expressions 101

Community Patterns

Community Library Entry

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