# Advanced Regex Request (move "(Feat. variable)" to end of title)

**URL:** https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191
**Category:** Support
**Created:** [September 29, 2014, 3:05am UTC](https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191 "2014-09-29T03:05:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![sparkyumr98](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sparkyumr98](https://community.mp3tag.de/u/sparkyumr98)
#### Post date: [September 29, 2014, 3:05am UTC](https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191/1 "2014-09-29T03:05:54Z")

</div>

Dear Regex gurus...

I have reached the limit of my regex knowledge, and cannot figure this problem out.

I have titles such as:

```
Song Title (Feat. Guest Artist) (Deejay Mix)
Song Title 2 (Remix version)
Song Title 3 (Feat. Backup Singer)
Song Title 4 (Mega Dub) (Feat. Someone)

```

I'm looking for a regex set that would be able to grab the Featured Artist info (except for the parens) and isolate it in a temporary field so that I could append it to the end of the Track Artist field.

I started with FORMAT VALUE "TEMP1": %TITLE% and FORMAT VALUE "TEMP2": %TITLE%, then Regex TEMP1: ^(.+)((.+))$ -\> $1 and

```
Regex TEMP2: ^(.+)\((.+)\)$ -> $2 (and putting TEMP2 after ARTIST and TEMP1 back into TITLE)

```

but this doesn't check to see if the TEMP2 actually contains "Feat."

The other thing I've been working with is ([Ff]eat[^)]+), but I don't know how to capture this group so that it could go into another field... and it leaves "()" behind since it ignores the opening and closing parentheses.

Any ideas?

---

<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: [September 29, 2014, 4:43am UTC](https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191/2 "2014-09-29T04:43:03Z")

</div>

I dunno:  
Perhaps the regexp approach is not right.  
Have you tried "Import Tag field (Guess values)"?  
e.g.  
Song Title 3 (Feat. Backup Singer)  
would look like this:  
%title% (Feat. %featartist%)

Or if you copy all of the title data into FEATARTIST (as a temporary field) and then apply the "Guess values" action, it would be:  
%dummy% (Feat. %featartist%)

For tracks like  
Song Title (Feat. Guest Artist) (Deejay Mix)  
I would prefer the copy-first-approach and then use:  
%dummy% (Feat. %featartist%) (%dummy%)

Finally you replace all (feat. .\*) with nothing in TITLE.  
And then you add the %featartist% to TITLE with format value.

---

<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: [September 29, 2014, 4:50am UTC](https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191/3 "2014-09-29T04:50:30Z")

</div>

> [@sparkyumr98](#):
>
> ... I'm looking for a regex set that would be able to grab the Featured Artist info (except for the parens) and isolate it in a temporary field so that I could append it to the end of the Track Artist field. ...

Move FEAT from TITLE to ARTIST and such alike ...  
[Video Edit Radio Version in Klammern löschen](https://community.mp3tag.de/t/15209/12)  
[" (feat.) " problem](https://community.mp3tag.de/t/14277/2)  
[/t/11096/1](https://community.mp3tag.de/t/11096/1)  
[/t/16034/1](https://community.mp3tag.de/t/16034/1)

DD.20140929.0850.CEST

---

<div class="post-metadata">

### Author: ![sparkyumr98](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sparkyumr98](https://community.mp3tag.de/u/sparkyumr98)
#### Post date: [September 30, 2014, 4:58pm UTC](https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191/4 "2014-09-30T16:58:53Z")

</div>

DD... that was amazing! I specifically used the first one you noted in thread 17973, copied here for posterity and reference:

ARTIST  
Formatstring: %ARTIST%' feat. '$regexp(%TITLE%,'^(.+?)\s+[[({\<]?(?:ft.?|feat.?|featuring)\s+(.+?)[])}\>]?\s\*((.+?))\s\*$','$2',1)  
"Titel (Ft. Artist 2) (Sososo Remix)" -\> "Artist 1 feat. Artist 2"  
"Titel Ft. Artist 2 (Sososo Remix)" -\> "Artist 1 feat. Artist 2"

TITLE  
Formatstring: $regexp(%TITLE%,'^(.+?)\s+[[({\<]?(?:ft.?|feat.?|featuring)\s+(.+?)[])}\>]?\s\*((.+?))\s\*$','$1 $3',1)  
"Titel (ft. Artist 2) (Sososo Remix)" -\> "Titel (Sososo Remix)"  
"Titel ft. Artist 2 (Sososo Remix)" -\> "Titel (Sososo Remix)"

I hadn't looked through the .de forums, since I learned French and Spanish in school....

Tausand Dank!

---

<div class="post-metadata">

### Author: ![sparkyumr98](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sparkyumr98](https://community.mp3tag.de/u/sparkyumr98)
#### Post date: [September 30, 2014, 7:15pm UTC](https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191/5 "2014-09-30T19:15:40Z")

</div>

Ok, one new issue.

I'm trying to automatically implement the filter that you mentioned in the previous thread:

```
Filter: "%TITLE%" MATCHES "^.+? \(?ft.+?\)? \(.+?\)$"

```

using an $if function.

My current attempt for the filter and the format string is:

```
$if(%TITLE%" MATCHES "^.+?\((?:[Ff]t.+?|[Ff]eat.+?|[Ff]eaturing.+?)\)\s*\(.+?\)$,%ARTIST%' feat. '$regexp(%TITLE%,'^(.+?)\s+[[({<]?(?:ft\.?|feat\.?|featuring)\s+(.+?)[])}>]?\s*(\(.+?\))\s*$','$2',1),%ARTIST%)

```

I've tested my MATCH function (^ to $) in an online regex tester ([regexpal.com](http://regexpal.com/)), and it appears to work properly.

Test case Titles are:

```
More of You (Feat. Rasul) (Soulmagic Classic Remix)
The Touch (Vocal Mix)
Born Free
Dreaming (Feat. Mr. Bailey)

```

When I test the MATCH function, only the first title highlights.  
When I try to run the whole $if function in MP3Tag, though, it would give me this sort of output.

```
ARTIST ~~~~~ TITLE
Alfred Azzetto feat. Rasul ~~~~~ More of You (Soulmagic Classic Remix)
J Nitti feat. The Touch (Vocal Mix) ~~~~~ The Touch (Vocal Mix)
Jay Vegas feat. Born Free ~~~~~ Born Free
Sandy Turnbull feat. Dreaming (Feat. Mr. Bailey) ~~~~~ Dreaming (Feat. Mr. Bailey)

```

Is there an implementation error that I'm not catching?

Danke!  
-S98

---

<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, 2014, 6:31am UTC](https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191/6 "2014-10-01T06:31:32Z")

</div>

> [@sparkyumr98](#):
>
> Ok, one new issue. ...  
> I'm trying to automatically implement the filter that you mentioned in the previous thread:...  
> Is there an implementation error that I'm not catching?

1. 

The "Mp3tag Filter [F3]" is a feature of the Mp3tag listview, which allows to _filter the listview_.  
The "Mp3tag Filter [F3]" has its own scripting language and operators, see manual.

The Mp3tag scripting language for _Actions_ is different.  
Do not apply both scripting languages into one format string for Actions.

1. 

If a regular expression in function $regexp() does not match, then the function returns the unchanged input string.

1. 

To simulate a 'does not match' filter ...  
$if($eql($regexp(Inputtext,RegExpr,RegRepl),Inputtext),DoNothing,DoSomething)  
$if($neql($regexp(Inputtext,RegExpr,RegRepl),Inputtext),DoSomething,DoNothing)  
... or ...  
To simulate a 'does match' filter ...  
$if($eql($regexp(Inputtext,RegExpr,),),$regexp(Inputtext,RegExpr,RegRepl),DoNothing)

DD.20141001.1031.CEST, DD.20150304.1351.CET

---

<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:25pm UTC](https://community.mp3tag.de/t/advanced-regex-request-move-feat-variable-to-end-of-title/16191/7 "2026-02-09T12:25:17Z")

</div>


