Regular Expressions 101

Community Patterns

Phone Number

1

Regular Expression
PCRE (PHP <7.3)

/
^(?:\([0-9]{3}\)|[0-9]{3})[-\s\.\/]?[0-9]{3}[-\s\.\/]?[0-9]{4}
/
gm

Description

123 456 7890 (123) 456 7890 (123) 456-7890 1234567890 123 456 7890 123 4567890 123.456.7890 123/456/7890

12 4567890 123 45 7890 123 456 789 12 45 78 123 456 7890 (123 456 7890 123) 456 7890 (123 456-7890 123) 456-7890

Submitted by anonymous - 3 years ago