On 16.03.2012 7:36, Joshua Niehus wrote:
Hello,

Does anyone know why I would get different results between
ctRegex and regex in the following snippet?

Ehm, because they have different engines that _should_ give identical results. And the default one apparently has a bug, that I'm looking into.
Fill the bug report plz.


Thanks,
Josh

---
#!/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"


--
Dmitry Olshansky

Reply via email to