Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?P<firstname>\b[A-Z][a-z]{1,}\b)\s{1}(?P<lastname>\b[A-Z][a-z]{1,}\b)$
/
g

Description

Format name listing by putting last name first

Submitted by Panagiotis Plevrakis - 7 years ago