Regular Expressions 101

Community Patterns

Match first letter of words for names

0

Regular Expression
PCRE (PHP <7.3)

/
(?>^|(?<=[\s-\.\'])) (\w)
/
gxu

Description

Also matches the first letter after ' or -

Submitted by anonymous - 3 years ago (Last modified 3 years ago)