Regular Expressions 101

Community Patterns

Basic Phone Number Matching

1

Regular Expression
ECMAScript (JavaScript)

/
^(?:\+1)?\(?([2-9]{0,1}[0-9]{2})\)?[. -]?([0-9]{3})[.-]?([0-9]{4})$
/
mg

Description

Basic Phone Number Matching

Submitted by Anthony Cooper - 3 years ago