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
/
^(?=([1-5]).*\1)(?=.+(?!\1)([1-5]).*\2)(?:\1|\2){5}$
/
gm
Input 1
1
New
11122 11221 11212 12211 12121 12112 22111 21211 21121 21112 1122 111222 11223
Substitution
11122 11221 11212 12211 12121 12112 22111 21211 21121 21112 1122 111222 11223