I try to construct patterns using Riffle and Except
StringExpression@Riffle[{"a", "b", "c"}, Except[{"=", ","}] ..]
and expect it to match "a_b_c", but not "a_bc" because Except is repeated .. one or more times.
However,
StringMatchQ["a_bc", StringExpression@Riffle[{"a", "b", "c"}, Except[{"=", ","}] ..]]
returns True. Could anyone explain why is it so?
First@StringPattern`PatternConvert@Riffle[{"a", "b", "c"}, Except[{"=", ","}] ..]
and comes out as(?ms)(?:a|(?:[^=,])+|b|(?:[^=,])+|c)
. Perhaps someone with more experience of using regular expressions will be able to suggest why this behaves as it does. $\endgroup$StringExpression@@
... $\endgroup$