Help me with this simple regex, pleeze! ^^

Hello fellow members!

I hope you had a prosperous xmas and a joyful new year!

I have this small issue at hands. In the %artist% field i have:

Barron Ricks/Chace Infinite/Cypress Hill

I want to rename this to Barron Ricks feat. Chace Infinite & Cypress Hill.

I lack the skills to nail this one, can you help?

Thanks in advance! :slight_smile:

Action: Format Value
Field: ARTIST
Formatstring: $regexp(%artist%,(.)/(.)/(.*),$1 feat. $2 & $3)

Hey Pone, thanks for the answer!

Well, the regex works spot on but it's unflexible.

Is it possible to turn it into a conditional such as this abstract demonstration:

If %artist% has name/name/name, change to "name feat. name & name". If %artist% has "name/name" then "name feat. name". If %artist% has "name" leave untouched.

Thanks! :slight_smile:

Well, this may be but on the other hand: language is so flexible. I can think of at least two artists that would fall into your pattern but shouldn't: AC/DC and Colourbox M/A/R/R/S

So, unless you have an absolutely unique separator between your artists (who, by the way, tagged them like that in the first place? Usually WMP transforms such a slash into a semicolon ...) it would be a good idea to filter the tracks first and check what kind of irregular entries you have.

It's true but i want to apply this conditional to specific situations, not artist names containing slash characters. :slight_smile:

You did not ask for flexibility the first time.
Anyway, here you go:
$ifgreater($strrchr(%artist%,/),$strchr(%artist%,/),$regexp(%artist%,(.)/(.)/(.),$1 feat. $2 & $3),$regexp(%artist%,(.)/(.*),$1 feat. $2))

Does not work for artist names with "/" in it like AC/DC and M/A/R/R/S and for collaborations of more than three artists.

Thanks man you're a lifesaver! :slight_smile: