Regular Expressions 101

Community Patterns

1...34567...902

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