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
/
^([\s\S]*?\/)(\w+\.c)
/
gm
Input 1
1
New
a/b/c/d/file1.c a/b/c/d/e/f/g/h/1/2/3/4/5/foo.c dir1/dir2/newlinedir /nextlinedir/bar.c
Substitution
a/b/c/d/file1.c a/b/c/d/e/f/g/h/1/2/3/4/5/foo.c dir1/dir2/newlinedir /nextlinedir/bar.c