Page 1 of 1

trimming the end of a file

Posted: 2016-02-13 20:01:27
by wolfkin
I would like to trim the end of a file name.

So for instance:

20160526[Raw].jpg
20160527[Raw].jpg
20160528[Scan].jpg
20160529[Scan].jpg
20160530[Complete].jpg
20160531[Complete].jpg

This is what I have so far

Code: Select all

Find: \[\w+].(jpg|png|gif|bmp)$
Replace: .$1
but I'm not sure how to make it work for folders like

EastofEden[Scan]

Posted: 2016-02-14 09:19:59
by antp
There is maybe a cleaner way to do it, but this seems to work:

Code: Select all

^(.+)\[\w+](\.(jpg|png|gif|bmp))?$

Code: Select all

$1$2