# Regular Expression includes first word of the tag when formatting a value

**URL:** <https://community.mp3tag.de/t/regular-expression-includes-first-word-of-the-tag-when-formatting-a-value/56258>\
**Category:** Support\
**Created:** [February 9, 2022, 7:40pm UTC](https://community.mp3tag.de/t/regular-expression-includes-first-word-of-the-tag-when-formatting-a-value/56258 "2022-02-09T19:40:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![accidental-fart](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@accidental-fart](https://community.mp3tag.de/u/accidental-fart)\
**Post date:** [February 9, 2022, 7:40pm UTC](https://community.mp3tag.de/t/regular-expression-includes-first-word-of-the-tag-when-formatting-a-value/56258/1 "2022-02-09T19:40:46Z")

</div>

I'm trying to move the featured artist into the artist tag using Format Value and $regexp.  
My current action looks like this:

Field:  
`ARTIST`

Format string:  
`%artist%\\$regexp(%TITLE%, (.*)\(feat\. (.*)\), $2)`

but for example on the track "What This Means (feat. Ouse)" by Powfu, it formats the ARTIST tag to `Powfu\\What Ouse`

Any help would be appreciated, thank you so much!

---

<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 9, 2022, 7:47pm UTC](https://community.mp3tag.de/t/regular-expression-includes-first-word-of-the-tag-when-formatting-a-value/56258/2 "2022-02-09T19:47:35Z")

</div>

You have a space character in the regular expression behind the first comma.  
`$regexp(%TITLE%, (.*)\(feat\. (.*)\), $2)`  
-\>  
`$regexp(%TITLE%,(.*)\(feat\. (.*)\), $2)`

---

<div class="post-metadata">

**Author:** ![accidental-fart](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@accidental-fart](https://community.mp3tag.de/u/accidental-fart)\
**Post date:** [February 9, 2022, 7:54pm UTC](https://community.mp3tag.de/t/regular-expression-includes-first-word-of-the-tag-when-formatting-a-value/56258/3 "2022-02-09T19:54:15Z")

</div>

Oh thank you so much.  
Now I have a new problem, whenever I'm tagging stuff in bulk, the titles without featuring artists just copy over into the artist tag, do you know of any way I could fix that or should I make another post for that?  
Thank you once again.

---

<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 9, 2022, 7:56pm UTC](https://community.mp3tag.de/t/regular-expression-includes-first-word-of-the-tag-when-formatting-a-value/56258/4 "2022-02-09T19:56:24Z")

</div>

I would never apply an action "blindly".  
In this case I would filter for the files with "feat." in the title:  
%title% HAS feat.  
and then apply the action.

---

<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:** [March 11, 2022, 7:57pm UTC](https://community.mp3tag.de/t/regular-expression-includes-first-word-of-the-tag-when-formatting-a-value/56258/5 "2022-03-11T19:57:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
