Regular Expressions 101

Community Patterns

US Phone number regex

0

Regular Expression
ECMAScript (JavaScript)

/
(?:(?:\\+|0{0,2})91(\\s*[\\- ]\\s*)?|[0 ]?)?[789]\\d{9}|(\\d[ -]?){10}\\d
/
g

Description

Matches formats such as the following: 555-555-5555 (555)555-5555 (555) 555-5555 555 555 5555 5555555555 1 555 555 5555

Submitted by anonymous - 2 years ago (Last modified 9 months ago)