[Issue 4574] New: std.regex : breaks with empy string regex

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 3 08:13:19 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4574

           Summary: std.regex : breaks with empy string regex
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bdom.pub+deebugz at gmail.com


--- Comment #0 from Bruno Medeiros <bdom.pub+deebugz at gmail.com> 2010-08-03 08:13:17 PDT ---
import std.regex; 

void main() {

    foreach(m; match("abcabcabab", regex(""))) {
        writefln("%s[%s]%s", m.pre, m.hit, m.post);
    }

}

----
throws:
core.exception.RangeError at std.regex(1848): Range violation

The empty string is a perfectly valid regex. (which, IIRC, should match an
input string named src (src.length+1) times)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list