Where do you test syntax of D regexp online?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 9 08:23:23 PST 2017


On Thursday, 9 March 2017 at 16:14:28 UTC, Suliman wrote:
> But now output is:
> [["```\r\nvoid foo()\r\n{\r\n\twriteln(\"ppp\");\r\n}\r\n```"]]
>
> But I do not \r\n\ symbols...

That's just the writeln array formatter. The matchFirst function 
returns an array of hits (that allows captures, btw you might 
need to use \( instead of ( to get the capture, god i hate regex) 
so writeln tries to print the whole array and that's how it does 
embedded newlines.

So you have the correct result, just written strangely.


More information about the Digitalmars-d-learn mailing list