Regular Expression assistance


Ok, need a little help here....

First off, anyone know of a good Regular Expression tutorial ? I'd like to learn how to do this myself...

While I dig around for one, would appreciate it if someone could enlighten me as to how I do the followig :

  • search for x-x and replace with x - x where x is any character
  • change the string track - artist - title (pres artist2) (mix_name) to track - artist pres artist2 - title (mix_name)
Fun facts about the second one :
  • 'track' and '(mix_name)' are optional
  • 'pres' may be 'feat' or 'vs.' - but all files will have one of the three
I would greatly appreciate any assistance offered.


$1 - $2

$1$2 $4 - $3$5

Mp3tag helpfile is good


Thanks for the help d4n0, but the second one didn't quite work.

Your suggestion resulted in :
track - artist mix_name - title (pres artist2)

when I am looking for :
track - artist pres artist2 - title (mix_name)

When I broke the results down into $1 - $2 - $3 - $4 - $5, it does not appear to be seperating the string title (pres artist2) into two compenents.

I checked the help file as you suggested, but apparently I am daft...

Any more suggestions ?


i have no clue why title (pres artist2) is always together :frowning:


Check the greedyness of the repeats in the parenthesis part. The regular expression
should work.

Best regards,
~ Florian


it does not work when there is no (mix_name) at the end


Oh yes, you're right! I've changed all repeats to be non-greedy in your regular expression and now it should work for both cases.

$1$2 $4 - $3$5

Best regards,
~ Florian


awesome, yes seems to be fine now
and i gotta find out what greedyness exactly is :smiley:


You can translate greedyness with "Gierigkeit". Greedy (standard) repeats are eating as much characters as possible - the non-greedy ones (those with the question mark after the repeat character) don't :slight_smile:

~ Florian


you guys rock....