Removing all caracters after last dash including dash

A swapping-ground for Regular Expression syntax

Removing all caracters after last dash including dash

Postby dw600 » Sat Apr 02, 2016 7:22 pm

I have about 1500 songs that when I created them the file name included the genre as the last part of the name and I would like to remove it from all the file names.

Example:
Anthology 1 (CD1) - 01 - Free As A Bird - RockPop
Billy Joel - Greatest Hits CD1 - 01 - Piano Man - Rock

Change to:
Anthology 1 (CD1) - 01 - Free As A Bird
Billy Joel - Greatest Hits CD1 - 01 - Piano Man
dw600
 
Posts: 1
Joined: Sat Apr 02, 2016 7:10 pm

Re: Removing all caracters after last dash including dash

Postby Admin » Tue Apr 05, 2016 12:54 am

Use RegEx (1) :

Match:
(.*)-(.*)
Replace:
\1

thanks
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm


Return to Regular Expressions