Regular Expressions 101

Community Patterns

Your search did not match anything

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
\+?1?(\-?| ?)\(?[2-9][0-9]{2}\)?(\-?| ?)[0-9]{3}(\-?| ?)[0-9]{4}
/
gm

Description

Format validation for U.S. phone numbers with or without a country code and with various formatting and punctuation permissible.

Submitted by Nick - a month ago