Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^\(?([0-9]{3})\)?[-. ]?([0-9]{3})(?:[-. ]?([0-9]{4}))?(?:[#. ]+([0-9]{1,10}))?$
/
gm
Test String
New
Examples: (555) 555-1212 (555) 555-1212 #12525 - Acceptable (Up to 10 digits after the # sign) 5555551212 555-555-1212 555-555-1212 #12525 - Acceptable (Up to 10 digits after the # sign) Any alpha characters should be Unacceptable (555) 555-1212 ext 12525 (555) 555-1212 x12525
Substitution
Processing...