import std.regex;
import std.array;
import std.stdio;
unittest {
auto f = `abc`;
auto re = `(()|(.+))`;
writeln(f.matchAll(re)); // Line 8
writeln(f.matchAll(re).array); // Line 9
}
In the above example, line 9 fails with:
core.exception.RangeError@D:\github\phobos\std\regex\package.d(576): Range violation
Changing the order of line 8 and 9, the problem disappears. Duplicating line 8 causes no exception.
The regex is shortened to the smallest I found that exhibits this behavior.