help removing a string nd the characters at each end


#1

I've read through all of the forum topics related to removing strings as well as the FAQ's. The only thing similar to what I need has to do with removing parentheses and what is contained within them. I've tried variations on that, but I can't get them to work.

I have about 300 songs where the ARTIST is something like this:
Singer --some words-- --some more words-- --maybe some random characters--

The characters between the -- are different for each artist. How can I remove the -- and everything between them?

Thanks in advance


#2

Begin Action Group _Script Test#TEST

Action #1 Actiontype 5: Format value Field ______: ARTIST Formatstring: $regexp(%artist%,'^([^-]+)\s+--.*','$1')

End Action Group _Script Test#TEST (1 Action)

See screenshot of how the regexp works.




#3

Converter: Tag -Tag
Field: ARTIST
Format string:

$left(%ARTIST%,$sub($strstr(%ARTIST%,' --'),1))

... or ...

$regexp(%ARTIST%,'^(.+?)(\s--.+--)+$','$1')

... or ...

$regexp(%ARTIST%,'\s--.+?--',)

From:
Singer --some words-- --some more words-- --maybe some random characters--
To:
Singer

DD.20121212.0745.CET