Regular Expressions 101

Community Patterns

email matcher

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?(DEFINE) (?'loc_part' [\w!#$%&'*+\-\/=?^`{|}~]+ ) (?'loc' \g'loc_part' (?: \. \g'loc_part' )* ) (?'subdom' [a-z] (?: [a-z\d-]* [a-z\d] )? ) (?'tld' [a-z]{2,6} ) ) (?'local' \g'loc' ) @ (?'domain' (?: \g'subdom' \. )+ \g'tld' )
/
ixg

Description

match some emails and extract their local part and domain

Submitted by dang duomg 191 - 23 days ago (Last modified 23 days ago)