Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
\+?[\d]?\s*\(?\d{3}\)?[\s\.-]?\d{3}[\s\.-]?\d{4}
/
gm

Description

Phone Number from the USA and similar countries using the a single-digit country code (optionally).

Submitted by Timothy Stam - 5 years ago