weird problem with Regex

A swapping-ground for Regular Expression syntax

weird problem with Regex

Postby bobbybadger » Wed May 01, 2019 7:15 pm

Hi

I have a bunch of MP3s that downloaded from my podcast program with an unwanted suffix to the name and I thought I'd use BRU to fix them. I use Regex at work a bit so I know the basics but I cannot get this to work in BRU.

Example;
#347 - Adam McKay.mp3awcollectionid=the-empire-podcast&awepisodeid=14019 I want to delete everything after .mp3, thus leaving a legit file name my mp3 player will understand

What I have been trying;
Match: (.+)(\.mp3)(.+)
Replace: \1

but it doesn't work. I think it is because of the file extension being involved. If Include Ext. is unticked nothing happens but with it on it doesn't do what I expect. I have tested my expression on regularexpresssions101 and it works so I am obviously missing something in BRU.

Any help appreciated - it's driving me mad!

thanks,
Bob
bobbybadger
 
Posts: 2
Joined: Wed May 01, 2019 7:01 pm

Re: weird problem with Regex

Postby therube » Wed May 01, 2019 9:47 pm

One way to go about it...

Renaming Options -> Ignore --> File Extensions (check)

5:Remove -> Crop -> After --> .mp3

-------

Another...

1:RegEx
Code: Select all
Match:  (.*\.mp3)
Replace:  \1


-------

Your method...

Change the Replace: to -> \1\2
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: weird problem with Regex

Postby bobbybadger » Wed May 01, 2019 11:24 pm

Thank you! I had tried the Remove options but it didn't work as expected but now you have pointed out Renaming Options -> Ignore --> File Extensions it does, as does my Regex (with a bit of tweaking). I'm learning - what a great bit of software!

Bob
bobbybadger
 
Posts: 2
Joined: Wed May 01, 2019 7:01 pm


Return to Regular Expressions