[Issue 7718] New: regex and ctRegex produce different results

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 16 09:01:08 PDT 2012


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

           Summary: regex and ctRegex produce different results
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: jm.niehus at gmail.com


--- Comment #0 from Joshua Niehus <jm.niehus at gmail.com> 2012-03-16 09:01:21 PDT ---
The following snippet produce different matches when they should be the same.  

#!/usr/local/bin/rdmd
import std.stdio, std.regex;

void main() {
    string strcmd = "./myApp.rb -os OSX -path \"/GIT/Ruby Apps/sec\" -conf 'no
timer'";

    auto ctre = ctRegex!(`(".*")|('.*')`, "g");
    auto   re =     regex (`(".*")|('.*')`, "g");

    auto ctm = match(strcmd, ctre);
    foreach(ct; ctm)
      writeln(ct.hit());

    auto m = match(strcmd, re);
    foreach(h; m)
      writeln(h.hit());
}
/* output */
"/GIT/Ruby Apps/sec"
'no timer'
"/GIT/Ruby Apps/sec"

-- 
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