std.range.byLine

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 12 06:23:54 PDT 2014


On Thursday, 11 September 2014 at 22:39:40 UTC, H. S. Teoh via 
Digitalmars-d-learn > Why not just use std.regex?
>
> 	foreach (line; myInput.split(regex(`\n|\r\n|\r`)))
> 	{
> 		...
> 	}
>
>
> T

I'll try the lazy variant of std.regex

  	foreach (line; myInput.splitter(regex(`\n|\r\n|\r`)))
  	{
  		...
  	}

I wonder if this is compatible with a ctRegex aswell. I'll try 
later.

See also: http://dlang.org/phobos/std_regex.html#.splitter

Thx


More information about the Digitalmars-d-learn mailing list