www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - 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;
}




Thank you for wonderful language!!

cheers,
--
rubikitch
http://www.rubyist.net/~rubikitch/
Feb 01 2007