Regular Expressions 101

Community Patterns

Simple Telephone number(America/Canada)

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 - 9 years ago