Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

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

Description

Allows optional variation in spaces and dashes and brackets as well as international numbers

Submitted by anonymous - 6 years ago