Regular Expressions 101

Community Patterns

1...34567...879

Valid Telephone Number

10

Regular Expression
ECMAScript (JavaScript)

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

Description

This regex validates varying types of telephone numbers.

Submitted by Adam Recvlohe - 8 years ago