Regular Expressions 101

Community Patterns

Phone number tests

1

Regular Expression
PCRE (PHP <7.3)

/
\+([0-9]{1,4})(?:\s?)\(([0-9]{1,6})\)(?:\s?)([ 0-9]{1,15})(?:\s?)(?:\-?)(?:\s?)([ \-0-9]{1,10})?(?:\s?)
/
g

Description

Test a given string for phone number variations and extract th parts.

Submitted by anonymous - 9 years ago