Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
\b((?(?<=\d{4})-?|)(\d)(?!\2{3}|\2{2}-\2|\2-\2{2}|-\2{3})){16}\b
/
g
Input 1
1
New
5123-4567-8912-3456 6123456789123456 4123356789123456 5133336789123456 1234567890134443 123-4567-8901-23456 1234-4567890123456
Substitution
5123-4567-8912-3456 6123456789123456 4123356789123456 5133336789123456 1234567890134443 123-4567-8901-23456 1234-4567890123456