Quote:
Originally Posted by ownedbycats
Code:
program:
[...]
# Returns topmost tag for all other books
else
re(sublist($tags, 0, 1, ','), '^(.*?)($|\..*$)', '\1')
fi
For the 'topmost tag', what would be the best way to specifically exclude '[Cleanup]'?
|
First question: what is a "topmost tag"? It seems that it is the first first hierarchical component of the first tag on the list, but as you can't depend on the order of tags in the list that seems wrong.
What do you want to have happen if the first tag is '[Cleanup]'? Do you want the second tag? if so then this would work:
Code:
t = sublist($tags, 0, 1, ',');
if t == "[CLEANUP]" then
t = sublist($tags, 1, 2, ',')
fi;
re(t, '^(.*?)($|\..*$)', '\1')