Bug 4574 – std.regex : breaks with empy string regex

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-03T08:13:00Z
Last change time
2011-06-06T08:11:08Z
Assigned to
andrei
Creator
bruno.do.medeiros+deebugz

Comments

Comment #0 by bruno.do.medeiros+deebugz — 2010-08-03T08:13:17Z
import std.regex; void main() { foreach(m; match("abcabcabab", regex(""))) { writefln("%s[%s]%s", m.pre, m.hit, m.post); } } ---- throws: [email protected](1848): Range violation The empty string is a perfectly valid regex. (which, IIRC, should match an input string named src (src.length+1) times)
Comment #1 by dmitry.olsh — 2011-06-06T08:11:08Z