Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-02-10 17:07
Flavor·PCRE2 (PHP)

/
\+?(\d?)[-\(\.]?(\d{3})[-\)\.\s]?(\d{3})[-\.\s]?\d{4}
/
gm
Open regex in editor

Description

Will verify a number that matches the pattern: [US International Code], [3-digit Area Code], [3 digits], [4 digits] And will return matches for all the digits together as a string (useful for href="tel:{number"), and each component of the number (including US International Code

Submitted by MegaSpaceHamlet