title: Ruby parslet: parsing multiple lines
body: <p>I'm looking for a way to match multiple lines Parslet.
  The code looks like this:</p>
  
  <pre><code>rule(:line) { (match('$').absent? &gt;&gt; any).repeat &gt;&gt; match('$') }
  rule(:lines) { line.repeat }
  </code></pre>
  
  <p>However, <code>lines</code> will always end up in an infinite loop which is because <code>match('$')</code> will endlessly repeat to match end of string.</p>
  
  <p><strong>Is it possible to match multiple lines that can be empty?</strong></p>
  
  <pre><code>irb(main)&gt; lines.parse($stdin.read)
  This
  is
  
  a
  multiline
  
  string^D
  </code></pre>
  
  <p>should match successfully. Am I missing something? I also tried <code>(match('$').absent? &gt;&gt; any.maybe).repeat(1) &gt;&gt; match('$')</code> but that doesn't match empty lines.</p>
  
  <p>Regards,<br>
  Danyel.</p>