Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
`
^abc4(?:.*(?:[^p].{2}|p[^r].{1}|pr[^e])|.{0,2})$
`
gm
Input 1
1
New
abc4back abc4backpre abc4front abc4frontpre abc3side abc3sidepre xyz4over xyz4overpre abc4
Substitution