Using the if function to check if "(feat." exists in title

Hello everybody, back with my daily question.
Today, I'm looking to check whether or not "(feat" exists within a file's TITLE field. I have an expression that will run if so, but I just need help with the identification portion.
Optimally, These should be recognized:
Track 1 (feat. Artist2)
Track 2 (Feat. Artist2) (remix)

But not these:
Track 1 feat. Artist 2
Track 2 Feat. Artist 2 (remix)

Like $ifgreater($strstr($lower(%title%),'(feat'),0,yes,no)
replace the "yes" and "no" with the functions that should be carried out in each case

1 Like

Great, that worked well. Could you tell me if there's any reason you used the $ifgreater function instead of an if(x,y,z)?
I'm just unsure the difference. By the way, you've helped me complete this:

$ifgreater($strstr($lower(%title%),'(feat'),0,$meta_sep(artist,\\)\\$regexp($replace($replace(%Title%,',' ,\\), & ,\\),'^(.+?)\s+[[({]?(?:ft\.?|feat\.?|featuring)\s+([^][(){}]+)[])}]?(\s+.+)?$','$2',1),$meta_sep(artist,\\))

Which will add a featured artist or multiple to the existing artist list only if there is one to add, but is safe to use on all files :slight_smile:

$strstr() returns the position as a number. The number is 0 if there is no hit.
So it checked for any value higher than 0 as this indicates that the search-string is somewhere in the source string.

1 Like

I see - Thanks for the explanation!

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