Regular Expressions 101

Community Patterns

Community Library Entry

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 - a year ago