It turns out that the failure has nothing to do with regular expressions. The query:
matches("","^(?:[^cde-[ag]]+)$")
correctly returns false because the empty string "" does not match one or more ('+') characters that are not [cde]. However the query:
every $s in tokenize("",",") satisfies matches($s,"^(?:[^cde-[ag]]+)$")
incorrectly returns true. Setting a breakpoint in strings_impl.cpp:1521 does nothing because in the latter case, the code never gets there so matches() is never called. Why not?
It turns out that the failure has nothing to do with regular expressions. The query:
matches( "","^(? :[^cde- [ag]]+) $")
correctly returns false because the empty string "" does not match one or more ('+') characters that are not [cde]. However the query:
every $s in tokenize("",",") satisfies matches( $s,"^(? :[^cde- [ag]]+) $")
incorrectly returns true. Setting a breakpoint in strings_ impl.cpp: 1521 does nothing because in the latter case, the code never gets there so matches() is never called. Why not?