First RegEx attempt

A swapping-ground for Regular Expression syntax

First RegEx attempt

Postby haukurhannes » Mon May 01, 2017 5:39 pm

Hey!

I just came across the Bulk Rename Utility and I'm working on a sample library which includes almost 75.000 files.
RegEx terrifies me since I have zero experience but I think that this could be the thing that fixes my issues, all help would be most appreciated!

My current string is for instance:

"HiHatRR1_China_Choke_1_50_27"

And what I would need it to be is

"HiHatChinaRR1_Choke_1_50_27"

The issue that I have is that not all of my files have an equal amount of characters (for instance "OHMonoRR5_Snare3_Rimshots_106_115_40") but all of them would need the same treatment; the part between the first underscore and the second to be moved before the "RR" and the additional underscore deleted.

Any and all help would be immensely appreciated!
haukurhannes
 
Posts: 2
Joined: Sun Apr 30, 2017 4:02 pm

Re: First RegEx attempt

Postby KenP » Mon May 01, 2017 6:56 pm

This should work.

RegEx (1)
Match: (.*)(RR\d*)_([^_]*)(.*)
Replace: \1\3\2\4
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: First RegEx attempt

Postby haukurhannes » Mon May 01, 2017 7:25 pm

Brilliant! Thank you it worked perfectly!
Loads of luck and happiness to you and your family :)
haukurhannes
 
Posts: 2
Joined: Sun Apr 30, 2017 4:02 pm


Return to Regular Expressions


cron