[Issue 2107] New: Regexp multiline attribute is broken

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 14 20:06:23 PDT 2008


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

           Summary: Regexp multiline attribute is broken
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: nyphbl8d at gmail.com


When matching on text that includes newlines, multiline matching (splitting the
string on newlines first and then matching on individual lines) seems to be the
default and makes the "m" attribute useless.  It also requires the removal of
all newlines if they need to be matched over.  The following code snippet
should show the issue:
if (auto m = std.regexp.search("foo\nbar","f.*r")) {
        writefln("match found: %s",m.match(0));
} else {
        writefln("no match!");
}


-- 



More information about the Digitalmars-d-bugs mailing list