May 30, 2009 Using regexp over newlines | ||||
---|---|---|---|---|
| ||||
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]); } } |
Copyright © 1999-2021 by the D Language Foundation