multiple replace with regex as last entry

Bulk Rename Utility How-To's

multiple replace with regex as last entry

Postby jimdaug » Thu Nov 07, 2024 6:15 pm

I'm not sure if I'm doing something wrong here. I'm using Replace with multiple entries and Remove boxes which are working well, except I need a regex to change all but the last underscore "_" to a hyphen "-" after all the other changes. But it seems that the regex in the last entry of a multiple replace does not work. For example, replace: \regex\(_(?=.*_)) with: - works, but replace: D|\regex\(_(?=.*_)) with X|- only replaces the D's. Is that a bug or am I missing something?

Thanks,
jimdaug
 
Posts: 3
Joined: Thu Nov 07, 2024 5:34 pm

Re: multiple replace with regex as last entry

Postby Admin » Fri Nov 08, 2024 12:03 am

Hi, Replace (3) only supports one regex, once you specify \regex\ then the whole expression becomes a regex.
You can use multiple regex in RegEx(1) and then change the order of operations in Special (14) so that Regex (1) is processed after the replacements Replace (3).
Admin
Site Admin
 
Posts: 2673
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To