I know how to solve the problem but it's necessary to switch from position based tags to named ones.
Once I've finished the script you'll see what I mean.
A short glimpse of how this will work e.g. for multiple audio streams:
Code: Select all
$desc = "#::#Audio_Channels="; // Must be preceded with the used separator
$tags = tagitems("tags", , <cc_item>);
$matches = regexmatches($tags, "$desc.*?(#::#|$)", <crlf>);
$trimmed = replacelist($matches, "$desc<crlf>#::#", "", <crlf>);
$joined = replace($trimmed, <crlf>, "/");
return $joined;
Code: Select all
$desc = "#::#Audio_Channels=";
return replace(replacelist(regexmatches(tagitems("tags", , <cc_item>), "$desc.*?(#::#|$)", <crlf>), "$desc<crlf>#::#", "", <crlf>), <crlf>, "/");