Using regexp over newlines
Jesse Phillips
jessekphillips at gmail.com
Sat May 30 14:58:24 PDT 2009
Maybe this is a bug, but what I'm trying to do is select a substring that
contains any number of new lines between some other regular expression.
I'm doing this in D2
import std.stdio;
import std.regexp;
void main() {
string tester2 = r"W((.*\n.*)+)z";//gives me 3 separate matches not 1.
string tester = r"W(.*)z";
auto r_exp = (RegExp(tester, "gmi")).search("Waat\nda\nzza");
foreach(m; r_exp) {
writeln(m[1]);
}
}
More information about the Digitalmars-d-learn
mailing list