A single regular expression to match.
The _attributes (g, i, m, s and x accepted)
Regex object that works on inputs having the same character width as pattern.
RegexException if there were any errors during compilation.
void test(S)() { // multi-pattern regex example S[] arr = [`([a-z]+):(\d+)`, `(\d+),\d+`]; auto multi = regex(arr); // multi regex S str = "abc:43 12,34"; auto m = str.matchAll(multi); assert(m.front.whichPattern == 1); assert(m.front[1] == "abc"); assert(m.front[2] == "43"); m.popFront(); assert(m.front.whichPattern == 2); assert(m.front[1] == "12"); } import std.meta : AliasSeq; static foreach (C; AliasSeq!(string, wstring, dstring)) // Test with const array of patterns - see https://issues.dlang.org/show_bug.cgi?id=20301 static foreach (S; AliasSeq!(C, const C, immutable C)) test!S();
Compile regular expression pattern for the later execution.