Reversing COMPOSER tags with multiple composers

After a hard drive accident, where I somehow lost thousands of composer tags, but somehow managed to keep all the sort composer tags, i'm left with quite a large job to do!

All of my sort composer tags are written like this:

Hilpert, Fritz, Hütter, Ralf, Schneider, Florian

Copying the SORT COMPOSER tag to the COMPOSER tag is no problem.

Is there a regular expression I could apply to tags like these that would re-order the tag into the correct format for me?

I.E:

Fritz Hilpert / Ralf Hütter / Florian Schneider

I know I would probably need to tweak the expression for composers with more / less names.

Many Thanks

Steve 45

A very unusual situation. Hard to believe, that a drive accident can corrupt only one tag-field in a music data file.

Not as elegant, but this seems to work ...

$trimRight($regexp($regexp(%COMPOSER%,'(.+?, .+?)(?:, |$)','$1 # '),'(.+?), (.+?)(?: # |$)','$2 $1 # '),' #')

... or this ...

$regexp($regexp($regexp(%COMPOSER%,'(.+?, .+?)(?:, |$)','$1 # '),'(.+?), (.+?)(?: # |$)','$2 $1 # '),' # $',)

... or this ...

$regexp($regexp(%COMPOSER%', ','(.+?), (.+?), ','$2 $1 # '),' # $',)

From:
Hilpert, Fritz, Hütter, Ralf, Schneider, Florian
To:
Fritz Hilpert # Ralf Hütter # Florian Schneider

DD.20110508.1345.CEST

Many thanks!

What actually happened was that I had my entire music collection open in MP3tag, we had a power cut, I don't remember why I had so many files highlighted, or why they were saved, but it wiped the composer tags!

Steve 45

Works like a dream! 5000 tags to check now!

Steve 45