View Single Post
Old 05-26-2019, 05:35 AM   #5
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: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by wishingstar View Post
Thanks BetterRed and chaley. I took a look at the boolean function link, would this also work?

Code:
str_in_list(field('tags'), ',', or('Sci-Fi', 'Fantasy') ....
No, that doesn't work. The or function does not compare strings. You would need to use a string compare operator inside the "or", which makes the function not appropriate in this situation.
Quote:
I think your solution, chaley, may be more robust using RegEx(?)
I am not sure about "robust" but it does the job.

NB: You could use the "str_in_list" function instead of in_list to avoid using regex. Something like this:
Code:
str_in_list(t, ',', 'Sci-Fi,Fantasy', strcat('eBooks/sci-fi or fantasy/', ta), strcat('eBooks/thriller/', ta))
chaley is offline   Reply With Quote