View mode: basic / threaded / horizontal-split · Log in · Help
February 01, 2007
std.regexp bug?
Hi!

I'm a D newbie from Ruby.
I do not figure out std.regexp.(match|exec|find)'s behavior.

private import std.regexp;

int main(char[][] argv) {
 // I think these are all matched.
 cast(void)(RegExp("hoge.boke", "m").test("hoge\nboke")); // => 0
 cast(void)(RegExp("hoge.boke", "m").match("hoge\nboke")); // => [] (should be ["hoge\nboke"])
 cast(void)(RegExp("hoge.boke", "m").exec("hoge\nboke")); // => [] (should be ["hoge\nboke"])
 cast(void)(RegExp("hoge.boke", "m").find("hoge\nboke")); // => -1 (should be 0)
 return 0;
}


# BTW, I'll release dxmp(annotator) soon.

Thank you for wonderful language!!

cheers,
--
rubikitch
http://www.rubyist.net/~rubikitch/
Top | Discussion index | About this forum | D home