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
/
^(.*?foo.*?)foo
/
gm
Input 1
1
New
foo bar bash 1 foo dash mesh 3 foo poly 3 for foo foo tar hash 1 foo gash gesh 3 foo toly 3 vor foo foo sar wash 1 foo rash nesh 3 foo koly 3 sor foo
Substitution