Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^\s*[a-zA-Z]+([\-\s']?[a-zA-Z]+)*\s*,\s*[a-zA-Z\s]+([\-\s']?[a-zA-Z]+)*\s*$
/
gm

Description

Useful for checking comma separated full names

Submitted by Bryan Luu - 4 years ago