Pattern.matches

Undocumented in source. Be warned that the author may not have intended to support it.
struct Pattern
@safe pure nothrow
matches
(
bool caseInsensitive
)
(
string input
)

Examples

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));
}

Meta