Closed muja closed 11 years ago
line = (match('$').absent? >> any).repeat >> match('$') line.parse("Hello world!") # => "Hello world!"@0 line.parse("Hello world!\n") # => "Hello world!\n"@0 line.repeat.parse("Hello\nThis\nis\na\nmultiline\nstring.") # never returns
Yes. Both repeats will accept a zero width match. The first one doesn't consume anything, the second one repeats that success.