# Validate Against Multi-Value Fields

**URL:** <https://community.mp3tag.de/t/validate-against-multi-value-fields/18096>\
**Category:** Support\
**Created:** [July 7, 2016, 11:02pm UTC](https://community.mp3tag.de/t/validate-against-multi-value-fields/18096 "2016-07-07T23:02:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [July 7, 2016, 11:02pm UTC](https://community.mp3tag.de/t/validate-against-multi-value-fields/18096/1 "2016-07-07T23:02:39Z")

</div>

Suppose I have one or more default composers. Is there a nice clean regex to compare a new incoming composer against the defaults?

$if($eql(%newcomposer%,%meta(%defaultcomposers,all),yes,no)?

I can obviously parse and search between \\, but I'm hoping for a solution that is more elegant.

Thx  
K

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [July 8, 2016, 6:04am UTC](https://community.mp3tag.de/t/validate-against-multi-value-fields/18096/2 "2016-07-08T06:04:19Z")

</div>

> [@rko31415](#):
>
> Suppose I have one or more default composers. Is there a nice clean regex to compare a new incoming composer against the defaults? ...

A regular expression is not needed, it can be solved using standard functions.

1. Convert the content from the multi-value tag-field COMPOSERS into a string:  
$meta\_sep(COMPOSERS,$char(9))$char(9)

2. Search the new composer within the string of composers:  
$strstr($meta\_sep(COMPOSERS,$char(9))$char(9),%COMPOSER%$char(9))

3. If the result from step 2 is zero, then the composer does not exist in the list of composers, otherwise the composer does exist already.  
$ifgreater($strstr($meta\_sep(COMPOSERS,$char(9))$char(9),%COMPOSER%$char(9)),0,'yes','no')

This is a case sensitive proposal.  
You can make it case insensitive by using function $lower or $upper.

DD.20160708.1004.CEST

---

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [July 8, 2016, 10:36am UTC](https://community.mp3tag.de/t/validate-against-multi-value-fields/18096/3 "2016-07-08T10:36:39Z")

</div>

Your approach is similar in concept to the one I am using, which makes the larger expression within which it is embedded look quite messy and difficult to interpret.

I'm not familiar with the meta concept and was hoping there was some secret magic equation, function or incantation that would accomplish the desired task with fewer leaps of programming logic.

And of course both your approach and my similar regexp approach gives false positives when the comparison is a substring of an existing composer (e.g., it considers composer=university valid when one of the default composers is university of south africa).

Thanks.

K

---

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [July 8, 2016, 3:32pm UTC](https://community.mp3tag.de/t/validate-against-multi-value-fields/18096/4 "2016-07-08T15:32:16Z")

</div>

Here's one that's a little bit shorter.

$if($eql($regexp(%composer%,(?:$meta\_sep(defaultcomposer,|)),),),yes,no)

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [July 9, 2016, 7:39am UTC](https://community.mp3tag.de/t/validate-against-multi-value-fields/18096/5 "2016-07-09T07:39:32Z")

</div>

> [@rko31415](#):
>
> ... And of course both your approach and my similar regexp approach gives false positives when the comparison is a substring of an existing composer (e.g., it considers composer=university valid when one of the default composers is university of south africa). ...

My first approach tries to reduce the false match of substrings, but it was not perfect yet, because each COMPOSER value needs a left and a right delimiter to give a distinctive value to compare.  
As the delimiter character I proposed the $char(9), because it nearly never exists in a COMPOSER value, but you are free to apply some other seldom used character as a delimiter.

This filterstring works for me:  
"$strstr('|'$meta\_sep(COMPOSERS,'|')'|','|'%COMPOSER%'|')" GREATER 0

... or equivalent as a formatstring ...  
$ifgreater($strstr('|'$meta\_sep(COMPOSERS,'|')'|','|'%COMPOSER%'|'),0,'yes','no')

DD.20160709.1143.CEST

---

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [July 9, 2016, 8:53am UTC](https://community.mp3tag.de/t/validate-against-multi-value-fields/18096/6 "2016-07-09T08:53:33Z")

</div>

Thx

---

<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:** [February 9, 2026, 12:26pm UTC](https://community.mp3tag.de/t/validate-against-multi-value-fields/18096/7 "2026-02-09T12:26:20Z")

</div>

Closed on February 9, 2026, 12:26pm UTC


