Regular Expressions 101

Community Patterns

Phone validation

0

Regular Expression
ECMAScript (JavaScript)

/
^(\+?(([0-9]){1,2})[- .]|\+?([0-9]{1,15}))?((((\(?([0-9]){2,3}\)?)[- .]){1,2}([0-9]{4,10}))|([0-9]{10}))s*(?:\s*(?:#|x\.?|ext\.?|ex\.)\s*(\d+\s*?))?$
/
mg

Description

Validates US and International. Spaces, dot or dash separator. Optional () These formats and variations of them pass this validation 1 (800) 888 8078 +1 402.536.4184 ext 8862088 +91.986.964.4357 +972546790128 +972 (0) 74-745-4014

Submitted by anonymous - 6 years ago