Regular Expressions 101

Community Patterns

GET EMAIL INFO (3)

1

Regular Expression
PCRE (PHP <7.3)

/
^(?<User>[_a-z0-9-]+(\.[_a-z0-9-]+)*(?<GmailTag>\+[\._a-z0-9-]+){0,1})@(?<Host>[a-z0-9-]+(\.[a-z0-9-]+)*\.[a-z]{2,4})$
/
i

Description

Get Gmail tag, user and domain of an email address. -- Fixed the bug that the label doesn't match if there are an dot on user.

Submitted by Matías Pizarro González - 9 years ago