Regular Expressions 101

Community Patterns

Email with gmail+ implementation

2

Regular Expression
PCRE2 (PHP >=7.3)

/
^[a-zA-Z0-9_.]+[+]?[a-zA-Z0-9]+[@]{1}[a-z0-9]+[\.][a-z]+$
/
gm

Description

Regex of email with ability to add gmail's +example system

example: root email = user@gmail.com gmail+ = user+extra@gmail.com

Submitted by brad - 2 years ago