Delete middle part of the name

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Delete middle part of the name

Postby lgj2288 » Tue Jun 27, 2017 10:26 am

I have a bunch of media files that are named like: C-0004-Cosi_4000x2000.png
I need to delete Cosi as is not needed, do you know by chance any regex i could use for it, because all of my media follow the same structure but they are too many to be done manually.

Posts: 1
Joined: Tue Jun 27, 2017 10:22 am

Re: Delete middle part of the name

Postby therube » Tue Jun 27, 2017 5:13 pm

See if this fits your needs:


Code: Select all
Match:  (^.*)-(.*_)?(.*)
Replace:  \1_\3

Code: Select all

Posts: 921
Joined: Mon Jan 18, 2016 6:23 pm

Return to Javascript Renaming