Action to extract information from the title

Hello, I have a lot of mp3s in which the title is structured as follows:

Hootology (Feat. BoriRock & Shaykh Hanif) (Remix) [Prod. By 4th Beats]

I would like to use an action to copy the following information from them:

%artists% : BoriRock & Shaykh Hanif
%composer% : 4th Beats

I can do it with tag - tag but not with an action

tag - tag

ARTISTS
$regexp(%title%,'.*? \(Feat\. (.*?)\).*',$1)
COMPOSER
$regexp(%title%,'.*?\[Prod\. By (.*?)\]',$1)

Can you help me with how I can pack this into an action?

The action equivalent to Convert>Tag-Tag is an action of the type "Format value"

BTW: this information was made available to you already in this thread:

Action from type "Format Value" that looks like this:


the same for COMPOSER with your second regular expression as Format string.

Results in

I just noticed another problem.

If the title doesn't have (Feat. xyz) and/or [Prod. By xyz], the whole title is copied. Can this be prevented?

Only if you adjust your regular expression.
A regular expression does not work for every variation.
You can either use several different regular expressions (and Actions) or you can try to fine-tune your existing one. Even this will not work for every thinkable form of TITLE content.

Do you have any idea how to check whether the title includes Feat. and/or Prod.?

Sorry, you have to build your examples and try it by your self, for example with the help of online tools like regex101.com.
I would have to do the same.

The easiest way would be to apply filters and then treat only matching files.

that works

$if($eql($regexp(%title%,'.*? \(Feat\. (.*?)\).*','$1'),%title%),, $regexp(%title%,'.*? \(Feat\. (.*?)\).*','$1'))  

Please test your functions and regular expressions carefully.
Your above THEN part would at least add a space in front of the extracted part, because of
,, $regexp
↑
Every character counts. :wink: