Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
PCRE (PHP <7.3)

/
^[0-9]{3}[\ ]{0,1}[0-9]{3}[\ ]{0,1}[0-9]{4}$
/

Description

Accepts spaces or not 1234567890 123 456 7890

Submitted by Christopher Dufort - 10 years ago