# Help me with this simple regex, pleeze! ^^

**URL:** https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527
**Category:** Support
**Created:** [February 1, 2011, 10:24am UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527 "2011-02-01T10:24:23Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [February 1, 2011, 10:24am UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527/1 "2011-02-01T10:24:23Z")

</div>

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! 🙂

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [February 1, 2011, 12:23pm UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527/2 "2011-02-01T12:23:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [February 1, 2011, 4:55pm UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527/3 "2011-02-01T16:55:10Z")

</div>

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! 🙂

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [February 1, 2011, 6:18pm UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527/4 "2011-02-01T18:18:50Z")

</div>

> [@Harakiri](#):
>
> .... Well, the regex works spot on but it's unflexible. ....

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.

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [February 1, 2011, 6:29pm UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527/5 "2011-02-01T18:29:03Z")

</div>

> [@ohrenkino](#):
>
> 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. 🙂

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [February 1, 2011, 6:59pm UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527/6 "2011-02-01T18:59:47Z")

</div>

> [@Harakiri](#):
>
> 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.

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.

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [February 1, 2011, 9:20pm UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527/7 "2011-02-01T21:20:27Z")

</div>

Thanks man you're a lifesaver! 🙂

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:22pm UTC](https://community.mp3tag.de/t/help-me-with-this-simple-regex-pleeze/11527/8 "2026-02-09T12:22:52Z")

</div>


