DEV Community

pineapplemeat
pineapplemeat

Posted on

Emacs Regex replace list of file paths with just filename

Paths with leading .

%s/\.\/.+\/\(.+\)$/\1/g
Enter fullscreen mode Exit fullscreen mode

Paths without leading .

%s/\/.+\/\(.+\)$/\1/g
Enter fullscreen mode Exit fullscreen mode

Top comments (0)