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

**URL:** <https://community.mp3tag.de/t/using-the-if-function-to-check-if-feat-exists-in-title/45967>\
**Category:** Support\
**Created:** [July 22, 2019, 5:20pm UTC](https://community.mp3tag.de/t/using-the-if-function-to-check-if-feat-exists-in-title/45967 "2019-07-22T17:20:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kramerman342](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kramerman342/32/6650_2.png) [@kramerman342](https://community.mp3tag.de/u/kramerman342)\
**Post date:** [July 22, 2019, 5:20pm UTC](https://community.mp3tag.de/t/using-the-if-function-to-check-if-feat-exists-in-title/45967/1 "2019-07-22T17:20:06Z")

</div>

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)

---

<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:** [July 22, 2019, 5:41pm UTC](https://community.mp3tag.de/t/using-the-if-function-to-check-if-feat-exists-in-title/45967/2 "2019-07-22T17:41:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kramerman342](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kramerman342/32/6650_2.png) [@kramerman342](https://community.mp3tag.de/u/kramerman342)\
**Post date:** [July 22, 2019, 6:06pm UTC](https://community.mp3tag.de/t/using-the-if-function-to-check-if-feat-exists-in-title/45967/3 "2019-07-22T18:06:17Z")

</div>

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 🙂

---

<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:** [July 22, 2019, 6:30pm UTC](https://community.mp3tag.de/t/using-the-if-function-to-check-if-feat-exists-in-title/45967/4 "2019-07-22T18:30:40Z")

</div>

$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.

---

<div class="post-metadata">

**Author:** ![kramerman342](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kramerman342/32/6650_2.png) [@kramerman342](https://community.mp3tag.de/u/kramerman342)\
**Post date:** [July 22, 2019, 6:45pm UTC](https://community.mp3tag.de/t/using-the-if-function-to-check-if-feat-exists-in-title/45967/5 "2019-07-22T18:45:58Z")

</div>

I see - Thanks for the explanation!

---

<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:** [August 21, 2019, 6:46pm UTC](https://community.mp3tag.de/t/using-the-if-function-to-check-if-feat-exists-in-title/45967/6 "2019-08-21T18:46:00Z")

</div>

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