Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^((Ma?c|[DdLlO][eao\'])?[A-Z][a-z]+)(( |-)((Ma?c|[DdLlO][eoa\'])?[A-Z][a-z]+))+$
/
gm

Description

A regular expression to validate Firstname Lastname, supports multiple names, de, le, O',L',l',d', prefixes.

Submitted by remedio - a year ago