Does anyone know what I'm doing wrong?
$if2($regexp(%title%,'(.*?)(\(|\[)(feat|ft)\.\s(.*?)\s*(\)|\])',%artist%; $4),%artist%)
Why does this copy the title to the artist tag if there is no feat. or ft. tag in the title? Should this not keep the artist's information as it is? It works perfectly in adding the artist when I need it to but I would prefer to just run the action on all songs rather than manually selecting the songs with feat.
For a better understanding of the regular expression itself:
Where did you get this regular expression? Did you make it yourself?
From the help documentation:
$if2(x,y) if x is true, x is returned, otherwise y.
Yep, I made the regex for the artist's information, I just looked at some of the logic and applied it to the examples I had for different titles. I usually test the regex on an online checker to see if it works the way I want, then convert it to use within mp3tag.
If no match is found in the expression, the whole search string gets returned.
$If2() produces the "x" part as %artist% returns valid data.
You can test a format string in Convert>Tag-Tag - which takes care of MP3tag's regular expression flavour.
Thanks, I've never used tag-tag before but I was able to resolve this by using $if($eql($regexp(%title%,'.*(\(|\[)(feat|Feat|ft|Ft)(\.\s)(.+)(\)|\]).*',1),1),$regexp(%title%,'(.+)?(\(|\[)(feat|Feat|ft|Ft)(\.\s)(.+)(\)|\])(.+)?',%artist%; $5,),%artist%)
The two regular expressions now looks like this:
and