Shouldn’t that query be:
$MyString.contains("Frac.*s")
I’m not sure but, could this not be done on the fly without needing to pre-store the string-ified list? IOW:
$MyList.format(" ").contains("Frac.*s")
So if $MyList olds the values ‘Frantic’, ‘Fractal’ and ‘Frames’, the string tested by .contains() becomes “Frantic;Fractal;Frames”.
Indeed, using the test doc to check @satikusala’s problem, if I make $Citation into a Set and use a query $Citation.format(“;”).contains(“Wun”), it works. Here is the test: Set-check.tbx (79.2 KB). The agent sets the tested note’s $Text simply to prove the target string being tested by the chained .contains is a string. You don’t have to use a semi-colon concatenation (i.e. the default list item delimiter) but if choosing a not letter character don’t choose one with a regex meaning.
Expectation management: cClearly, if one scales this to using the method on 000s of notes each with large numbers of list items and using a complex regex, performance may be less snappy. I’d assume users working at this scale would expect such an effect, but I still think it warrants noting for those as yet only working in small docs where the issue is moot.