when condition based on list

Is it possible to write something like “when: a and b and c”, but get the list [a,b,c] from a variable?

I have one command that outputs some data, which I register in a variable x. Then I want to see if all items from variable y are included in that output. If I were doing it manually, it might look like: "when x | search(“a”) and x | search(“b”) and x | search(“c”). But I’d like that list to be dynamic.

Any way to do this?

sounds like you mean do something like:

when: a in [‘x’,‘y’,‘z’]

or

when: x.foo in alist

??

Not exactly…I want each condition to be a regex on the output of the original command (which also contains a lot of other text). That’s why I was trying to use a “search” filter.