Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(\+\d{2,4})?\s?(\d{2,4}|\(\d{2,4}\))?\s?[\d\s.-]{3,15}$
/
gm

Description

Format for international and local telephone numbers. Country code and area code are optional. Country code format using a plus sign. Area code format using optional parentesis. Phone number accepts spaces, dots and dashes (up to 15 characters).

Submitted by anonymous - 4 years ago