Bug 17875 – Range violation in std.regex

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2017-10-04T08:13:43Z
Last change time
2018-09-20T07:49:59Z
Assigned to
No Owner
Creator
Simen Kjaeraas

Comments

Comment #0 by simen.kjaras — 2017-10-04T08:13:43Z
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.
Comment #1 by simen.kjaras — 2018-09-20T07:49:59Z
Works for me with 2.081.1