On Saturday, 15 September 2018 at 20:04:36 UTC, berni wrote:
Anotherone I'm not getting to work: From some output with
newlines I want to discard all lines, that start with a # and
select part of the other lines with a regex. (I know the regex
r".*" is quite useless, but it will be replaced by something
more usefull.)
I tried the following, but non worked:
output.split("\n").filter!(a=>a.length>0 &&
a[0]!='#').matchFirst(r".*");
output.split("\n").filter!(a=>a.length>0 &&
a[0]!='#').array.matchFirst(r".*");
output.split("\n").filter!(a=>a.length>0 &&
a[0]!='#').array.map!(matchFirst(r".*"));
output.split("\n").filter!(a=>a.length>0 &&
a[0]!='#').array.map!(a=>matchFirst(a,r".*"));
Any ideas?
Your last example works for me: https://run.dlang.io/is/F5n3mk
Can you post a complete, runnable example that illustrates your
problem?