Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(?:(\+[0-9]{1,3})[ -])?\(?\d{3}\)?[- ]?\d{3}[- ]?\d{4}
/
igm

Description

This recognizes phone numbers, including country codes if they're present.

Submitted by Phoenix Staley - 3 years ago