Regular Expressions 101

Community Patterns

Full name split

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(?<last_name>[\w]+)\s*,\s*(?<first_name>[\w]+)\s*(?<middle_initial>.*|$)
/
gm

Description

It allows to divide the full name into its three parts

Submitted by anonymous - 8 months ago