View Single Post
Old 05-08-2021, 06:24 PM   #97
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,451
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
@chaley: Running the following template returns true i.e "1"

Code:
program:
	'' inlist 'first,second'
Is this the intentional?
Yes. It uses python regex where a zero-length pattern matches any string.

It isn't clear to me what the expression is looking for. If you looking for an empty list then there are several ways to do that, such as a == '' or list_count() == 0. If you are looking for an item in a list then you must explicitly decide what happens if the item is empty. Does it match, or does it fail? If you know you want the left-hand expression to match *something* then you can use
Code:
substr('^', value, '$') inlist whatever
or perhaps clearer, str_in_list()
chaley is offline   Reply With Quote