digitalmars.D.learn - my regexp is over the ocean...
- 0ffh (16/16) Jun 23 2007 Hi!
Hi! Can anybody tell me what I do wrong in the second alternative? void testRE() { // alternative 1 : works if (auto m=std.regexp.search("abcde","^abc")) printf("alt 1 match '%s'\n",toStringz(m.match(0))); else printf("alt 1 no match\n"); // alternative 2 : why not? if (auto m=(RegExp("^abc").search("abcde"))) printf("alt 2 match '%s'\n",toStringz(m.match(0))); else printf("alt 2 no match\n"); } Regards, Frank
Jun 23 2007