Regular Expressions 101

Community Patterns

123...6

Phone Number

14

Regular Expression
ECMAScript (JavaScript)

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

Description

Allows phone numbers with optional country code, optional special characters and whitespace

Submitted by Tlmader - 9 years ago