Page 1 of 1

Move all text after "keyword" to front of file name

PostPosted: Tue Apr 28, 2020 2:47 am
by KarnbirR
Hello,

Im trying to figure out how I can switch text after by to the front of my file names.

Eg.

iPhone by Apple

to

Apple - iPhone

This looks like a RegEx type of issue, I'm not sure how to tell BRU to take all text after a certain phrase

Your help is much appreciated! :)

Re: Move all text after "keyword" to front of file name

PostPosted: Tue Apr 28, 2020 4:05 am
by Admin
Try:

Match : (?i)(.*)by(.*)
Replace: \2 - \1

Re: Move all text after "keyword" to front of file name

PostPosted: Tue Apr 28, 2020 4:07 am
by therube
1:RegEx
Code: Select all
Match:  (.*)\sby\s(.*)
Replace:  \2 - \1


Find anything up to the last instance of <space>by<space>, then everything that follows it, switching their orders, with a dash thrown in.

Re: Move all text after "keyword" to front of file name

PostPosted: Tue Apr 28, 2020 5:34 am
by KarnbirR
Admin wrote:Try:

Match : (?i)(.*)by(.*)
Replace: \2 - \1
therube wrote:1:RegEx
Code: Select all
Match:  (.*)\sby\s(.*)
Replace:  \2 - \1


Find anything up to the last instance of <space>by<space>, then everything that follows it, switching their orders, with a dash thrown in.


Both of these worked flawlessly! Thank you so much! I love BRU such a great utility, just a little steep learning curve :)