Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^ (?: (?:\+|00|011)[\.\/\-\ \t]* (?# group 1: country code after international dialing code) ([17]|2(?:[07]|[1-689]\d)|3(?:[0-4679]|[578]\d)|4(?:[013-9]|2\d)|5(?:[1-8]|[09]\d)|6(?:[0-6]|[789]\d)|8(?:[1246]|[035789]\d)|9(?:[0-58]|[679]\d)) [\.\/\-\ \t]* | (?# group 2: single-digit country code without international dialing code) ([17]) [\.\/\-\ \t]+(?# a separator is required for disambiguation) )? (?# group 3: area code between parentheses, optional) (?:\((\d{1,4})\)[\.\/\-\ \t]*)? (?# groups 4-7: leading groups of digits, may be empty) (?:(\d{1,6})[\.\/\-\ ])? (?:(\d{1,6})[\.\/\-\ ])? (?:(\d{1,6})[\.\/\-\ ])? (?:(\d{1,6})[\.\/\-\ ])? (?# group 8: start of the last group of digits, may be empty) (\d{0,10}?) (?# group 9: up to 4 digits at end of the last group of digits) (\d{1,4}+) (?: [\.\/\-;\ \t]*e?xt?[\.\/\-=\ \t]*+ (?# group 10: extension code, optional) (\d{1,14}) )? $
/
mgxi
Unit Tests