Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
phone regex
Open Workspace
JavaScript
Match
Created 2014-10-31 17:31
2
Regular Expression
/
(?=
.
*?
\d
{3}
(
|
-
|
.
)?
\d
{4}
)(
(?:
\+
?
(?:
1
)(?:
\1
|
\s
*?
)
)?(?:
(?:
\d
{3}
\s
*?
)
|
(?:
\(
(?:
\d
{3}
)
\)
\s
*?
)
)
\1
?
(?:
\d
{3}
)
\1
?
(?:
\d
{4}
)(?:
\s
*?
(?:
#
|
(?:
ext
\.
?
)
)(?:
\d
{1,5}
)
)?
)
\b
/
gi
Description
Match phone number with extensions or not
Submitted by
Mélissa Dumont