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.