Removing Repeated Words in File Names

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

Re: Removing Repeated Words in File Names

Postby Luuk » Fri Sep 18, 2020 8:28 am

Greetings. Im not can do with javascript, but changing the regex is much easier. The first customer wanted both words begin with "_" and also to keep the "_" but yours is only one "_" and also you consider the "_" is illegal, so I move the "_" outside of the groups. Also Im think the red "2," is to small so change to "4," to recognize 4 or more symbols like "July" or bigger, so you must change to 3 for small words like "May" but careful to look at the names before you execute rename.

Code: Select all
(.*?)([^_]{4,})_(.*)\2(.*)


There is probably easier way with new version to give more options like %1_%2 and replace with %2 but Im not study yet.
Luuk
 
Posts: 27
Joined: Fri Feb 21, 2020 10:58 pm

Previous

Return to Javascript Renaming