Regular Expressions 101

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^[a-zA-Z]+[\'-]{0,1}[a-zA-Z]+$
/
i

Description

Names that accept maximum of 1 hyphen or 1 Quote, does not allow white spaces, allows an unlimited length of name.

Submitted by chakra_tavy - 9 years ago