www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4574] New: std.regex : breaks with empy string regex

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: bdom.pub+deebugz gmail.com


--- Comment #0 from Bruno Medeiros <bdom.pub+deebugz 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 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: -------
Aug 03 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4574


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 09 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4574


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |dmitry.olsh gmail.com
         Resolution|                            |FIXED


--- Comment #1 from Dmitry Olshansky <dmitry.olsh gmail.com> 2011-06-06
08:11:08 PDT ---
Fixed in version 2.053
https://github.com/D-Programming-Language/phobos/commit/da4a902341af2607199e0e23e9f954294d09bf2c

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