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
/
\b26?([^7]6|8|[^6]7)+?4\b
/
gm
Input 1
1
New
Samples of valid strings are like 26874 '266868874', '268787866668887774', '268688788774'. 26666868886688874 '26878787868888666878868686866668688887888687774' Invalid strings are like '263874', '268734', '2688668778868714', etc... 2324235235980980 26876874 You CAN NOT transit from 7 to 6 in one step. Only '7-8-6-8-7-4' would happen, not '7-6-8-7-4'