Regular Expressions 101

Community Patterns

US Number

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(1\s?)?(\d{3}|\(\d{3}\))[\-\s]?\d{3}[\-\s]?\d{4}$
/
gm

Description

I write this to complete the Freecodecamp asssignment. This page very helpful Thanks aksonai for bringing me here

Submitted by anonymous - 2 years ago