RegExp "." dos not match any character, as it misses newline
yidabu
yidabu.nospam at gmail.com
Thu May 3 14:35:39 PDT 2007
code:
import std.stdio;
import std.regexp;
void main()
{
char[] str = r"a
b";
char[] pattern = ".+";
if ( RegExp(pattern).test(str) )
{
str = RegExp(pattern).match(str)[0];//无论用什么Attribute,总是只匹配第一行的a,也就是.无法跨行
writefln(str);
}
else {writefln("failed");}
}
output:a
seems "." dos not match any character, as it misses newline
More information about the Digitalmars-d-bugs
mailing list