# Regular Expression searching left to right help

**URL:** https://community.mp3tag.de/t/regular-expression-searching-left-to-right-help/19396
**Category:** Support
**Created:** [October 1, 2017, 1:50pm UTC](https://community.mp3tag.de/t/regular-expression-searching-left-to-right-help/19396 "2017-10-01T13:50:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [October 1, 2017, 1:50pm UTC](https://community.mp3tag.de/t/regular-expression-searching-left-to-right-help/19396/1 "2017-10-01T13:50:50Z")

</div>

I have some songs with Artists with multiple commas (supporting artists).

I am looking for conditional comparison and replacing.

So my artist name would be like:

Artist Name, sub-artist1, sub-artist2, subtist-xxx......

I've been manually replacing the first "," with FEAT. and then use an action with regular expression to replace "," with "&".

I want it to look like:

Artist Name FEAT. sub-artist1 & sub-artist2 & subtist-xxx......

So I can't sort out how to only find the first "," replace it to FEAT. and then scan the rest of the artist to replace all subsequent "," to "&"

I know I can combine two actions together, but the logic to only search for the first iteration of the "," I can't seem to figure out.

Anyone have some thoughts on how to approach this?

Thank you.  
Chris

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 1, 2017, 3:24pm UTC](https://community.mp3tag.de/t/regular-expression-searching-left-to-right-help/19396/2 "2017-10-01T15:24:30Z")

</div>

> [@kittmaster](#):
>
> ... my artist name would be like:  
> Artist Name, sub-artist1, sub-artist2, subtist-xxx......  
> I want it to look like:  
> Artist Name FEAT. sub-artist1 & sub-artist2 & subtist-xxx......

Example:

**$regexp($regexp('Artist Name, sub-artist1, sub-artist2, sub-artist3',', ',' & '),'^([^&]+) &','$1 FEAT.') ==\> "Artist Name FEAT. sub-artist1 & sub-artist2 & sub-artist3"**

DD.20171001.1924.CEST

**ARTIST \<== $regexp($regexp(%ARTIST%,', ',' & '),'^([^&]+) &','$1 FEAT.') ... or ... ARTIST \<== $regexp($replace(%ARTIST%,', ',' & '),'^([^&]+) &','$1 FEAT.')**

DD.20171002.0753.CEST

---

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [October 1, 2017, 7:52pm UTC](https://community.mp3tag.de/t/regular-expression-searching-left-to-right-help/19396/3 "2017-10-01T19:52:56Z")

</div>

Hi Dave,

I tried it as a format value in the %artist% field, didn't do what I was expecting. I've attached a screenshot for clarity. I think I didn't provide all the info correctly and I apologize for that.

So with the attached screen shot, the arrows show the two different scenarios I have.

So track #3 I would like to end up with:

HAILEE STEINFELD FEAT. ALESSO & FLORIDA GEORGIA LINE & WATT

and for track #7

MATY NOYES FEAT. TESTME

I see what your example does, I "think" it required the action format value in the %artist% field. If I was incorrect, is there something I should do differently?

Thanks again for all your help.

Chris

 ![](https://community.mp3tag.de/uploads/default/original/2X/b/bf6bf46dc5885e64c0b78c0073ab3bfae1aeb864.png)

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 2, 2017, 3:47am UTC](https://community.mp3tag.de/t/regular-expression-searching-left-to-right-help/19396/4 "2017-10-02T03:47:53Z")

</div>

> [@kittmaster](#):
>
> Hi Dave, ...

? ? ?

> [@kittmaster](#):
>
> ... So track #3 I would like to end up with:  
> HAILEE STEINFELD FEAT. ALESSO & FLORIDA GEORGIA LINE & WATT  
> and for track #7  
> MATY NOYES FEAT. TESTME ...

For now ... the given proposal does what you have wanted by your request.  
You may apply the given formatstring within the action "Format value" or within the converter "Tag-Tag", the converter offers a preview.  
Please define the new problem in other words and give a proper example of a possible failure.

DD.20171002.0747.CEST

Here is a coding variation of the first proposal ...

**ARTIST \<== 'HAILEE STEINFELD, ALESSO, FLORIDA GEORGIA LINE, WATT' ARTIST \<== $replace($regexp(%ARTIST%,'^([^,]+),','$1 FEAT.'),', ',' & ') ARTIST ==\> 'HAILEE STEINFELD FEAT. ALESSO & FLORIDA GEORGIA LINE & WATT' ARTIST \<== 'MATY NOYES, TESTME' ARTIST \<== $replace($regexp(%ARTIST%,'^([^,]+),','$1 FEAT.'),', ',' & ') ARTIST ==\> 'MATY NOYES FEAT. TESTME'**

DD.20171002.1000.CEST

---

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [October 2, 2017, 3:46pm UTC](https://community.mp3tag.de/t/regular-expression-searching-left-to-right-help/19396/5 "2017-10-02T15:46:43Z")

</div>

> [@DetlevD](#):
>
> ? ? ?
> 
> For now ... the given proposal does what you have wanted by your request.  
> You may apply the given formatstring within the action "Format value" or within the converter "Tag-Tag", the converter offers a preview.  
> Please define the new problem in other words and give a proper example of a possible failure.
> 
> DD.20171002.0747.CEST
> 
> Here is a coding variation of the first proposal ...
> 
> **ARTIST \<== 'HAILEE STEINFELD, ALESSO, FLORIDA GEORGIA LINE, WATT' ARTIST \<== $replace($regexp(%ARTIST%,'^([^,]+),','$1 FEAT.'),', ',' & ') ARTIST ==\> 'HAILEE STEINFELD FEAT. ALESSO & FLORIDA GEORGIA LINE & WATT' ARTIST \<== 'MATY NOYES, TESTME' ARTIST \<== $replace($regexp(%ARTIST%,'^([^,]+),','$1 FEAT.'),', ',' & ') ARTIST ==\> 'MATY NOYES FEAT. TESTME'**
> 
> DD.20171002.1000.CEST

I recall reading someone saying Dave and I "thought" you responded to that name, I of course, could be very wrong with my assumption or poor memory recall, and I guess it just stuck.....I apologize if I called you by an incorrect name.

I ended up realizing what I was doing wrong with your first post method.

I stuck %artist% in the format field chooser instead of ARTIST.

When I used:

$regexp($regexp(%ARTIST%,', ',' & '),'^([^&]+) &','$1 FEAT.')

which was taken from your first post, it worked exactly as it should.

Thank you again for your help.

Best,  
Chris

---

<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:27pm UTC](https://community.mp3tag.de/t/regular-expression-searching-left-to-right-help/19396/6 "2026-02-09T12:27:02Z")

</div>


