import std.algorithm : equal; auto p = Pattern.parse("a|A"); { enum caseInsensitive = true; assert(equal(p.matches!(caseInsensitive)("a"), ["a", "A"])); assert(equal(p.matches!(caseInsensitive)("b"), string[].init)); } { enum caseInsensitive = false; assert(equal(p.matches!(caseInsensitive)("a"), ["a"])); assert(equal(p.matches!(caseInsensitive)("A"), ["A"])); assert(equal(p.matches!(caseInsensitive)("b"), string[].init)); }