My first thought is to count the items in the list:
Code:
program:
f = $formats;
if
(count(f, ',') == 1) && (list_contains(f, ',', '^epub$', '1', '') )
then 'foobar'
fi
But, you can just do:
Code:
program:
f = $formats;
if
contains(f, '^epub$', '1', '')
then 'foobar'
fi