The following assert fails, but should not.
assert(!inPattern('a', "äöüa-z"));
The problem is the combination of "foreach (size_t i, dchar p; pattern)" with "i + 1 < pattern.length". Due to foreach "i" is the index of the code point, but the comparison assumes an index of code unit. The pattern string consists of 6 code points, but 9 code units.
Comment #1 by qznc — 2013-12-09T22:35:46Z
Sorry, confusion on my part. The assertion is wrong, inPattern is correct.