Hi all
I'm currently testing the following flow:
Regex for Action 4: [\.']
Regex for Action 5: [^a-zA-Z0-9]|__+
What I'm trying to do: Replace the umlauts with their ASCII-friendly counterparts, replace dots and apostrophes with nothing and then replace everything that's not a letter or a digit with an underscore. Following this procedure, there are sometimes multiple underscores in a row which I want to reduce with the second part of the regex in Action 5. But for some reason, recursive doesn't work for that last action, Switch only replaces the first match. When I set 'Repeat' to 'Consecutive', it works but the multiple underscores stay. I know I could add another Rename Job element after this but that's not really as elegant . Any ideas what I'm missing?
Recursive on Rename Job not working
Re: Recursive on Rename Job not working
Try with the Action - Reduce character set to get rid of all the special characters and then an action to replace multiple underscores. The regex for that is just _+ and replace it by a single underscore.
Re: Recursive on Rename Job not working
Reduce character set doesn't work for my case unfortunately. I use this method to "normalize" metadata from an ERP to then create folders with that information. These folder names should not contain anything but letters and numbers. Reduce character set doesn't get rid of characters like spaces, dashes or ampersands. I think my method is correct but "recursive" isn't performing as expected...
Re: Recursive on Rename Job not working
The regex for action 5 says to match anything that is not alphanumeric or that is two underscores one or more times. But underscores are also not alphanumeric and replace one or more by one is also correct. I would say the regex simply has to be [^a-zA-Z0-9]+ which means replace one or more non-alphanumeric characters by an underscore, recursively.
Re: Recursive on Rename Job not working
That's a good point regarding my regex. You're right of course. I changed it to the regex you suggested but recursive still doesn't work. But consecutive processes the files in the way I want, so that's solved. Thanks Freddy!freddyp wrote: ↑Tue Mar 01, 2022 5:06 pm The regex for action 5 says to match anything that is not alphanumeric or that is two underscores one or more times. But underscores are also not alphanumeric and replace one or more by one is also correct. I would say the regex simply has to be [^a-zA-Z0-9]+ which means replace one or more non-alphanumeric characters by an underscore, recursively.