Getting rid of the ~

A swapping-ground for Regular Expression syntax

Getting rid of the ~

Postby enhompe » Sat Sep 24, 2016 5:07 pm

I have a lot of mp3 files starting with the artist's last name first,then a ~ (squiggle) then the first name. (My old DOS-based program, File Express, did it that way.) Now File Express is long dead, I've forgotten everything I knew about expressions, and I'm left with a lot of files to rename. Here are two examples:

Now:
Badu~Eryka - Danger.mp3
Needed:
Eryka Badu - Danger.mp3

Another example:
Now: Trent D'Arby~Terence - Designated Fool.mp3
Needed:
Terence Trent D'Arby - Designated Fool

So I need to move the characters between the ~ squiggle and the - hyphen to the front of the filename. (Once that's done I'll remove the squiggles and I'll be golden.)

Anyone who can help with this, I'd be extremely grateful.
enhompe
 
Posts: 7
Joined: Sat Oct 25, 2014 4:30 pm

Re: Getting rid of the ~

Postby KenP » Sat Sep 24, 2016 7:17 pm

Try this.

RegEx (1)
Match: (.*)~(.*)-(.*)
Replace: \2\1 -\3
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am


Return to Regular Expressions