Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^\p{L}+(['-]\p{L}+)*\.?(\s\p{L}+(['-]\p{L}+)*\.?)*$
/
g

Description

One or more words, separated by one space. Allowed letters from any alphabet, dashes, dots and spaces (not more than one successively). Must begin with a letter and end with a letter or dot.

Submitted by kostya - 7 years ago