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


#1

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?


"feat. .." vom Titel - hinter den Interpreten
Copy Feat. tags to Album Artist field
"Feat." aus ARTIST nach TITLE kopieren - Wie?
#2

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.


#3

Move FEAT from TITLE to ARTIST and such alike ...
Video Edit Radio Version in Klammern löschen
" (feat.) " problem
/t/11096/1
/t/16034/1

DD.20140929.0850.CEST


#4

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!


#5

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), 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


#6

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.

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

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