RegEx and Lists

Bulk Rename Utility How-To's

RegEx and Lists

Postby TaketaD » Sat Feb 10, 2024 11:34 pm

At the moment I'm using the RegEx field to find and move a given word to the beginning of file name, using this:

Code: Select all
(?i)(^|.+) Word( .+|$)
Word - \1\3
Based on help received HERE

What I'd like to be able to do instead, if possible, is to maintain a list of Words would then be used here instead of an individual Word. For example, in my list I'd have Apple, Orange, Banana and the above RegEx would look for each of those words and, if found, move it to the beginning of the filename. As time goes on I could just add a new word to the list. This would save me the trouble of needing to execute this regex on each Word individually, as my list is growing quite lengthy.
TaketaD
 
Posts: 5
Joined: Wed Aug 02, 2023 2:32 am

Re: RegEx and Lists

Postby Admin » Sun Feb 11, 2024 5:20 am

Probably best to do this with a Javascript script in BRU, if you have a commercial license....
Admin
Site Admin
 
Posts: 2331
Joined: Tue Mar 08, 2005 8:39 pm

Re: RegEx and Lists

Postby TaketaD » Fri Feb 16, 2024 6:22 am

Oh boy, I'm extremely rusty with my JS. But what does a commercial license have to do with anything?
TaketaD
 
Posts: 5
Joined: Wed Aug 02, 2023 2:32 am

Re: RegEx and Lists

Postby Admin » Sat Feb 17, 2024 1:25 am

At the moment JavaScript renaming in Bulk Rename Utility is only available with a commercial license. We can help write the script.
Admin
Site Admin
 
Posts: 2331
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To