title: Detecting the end of a multiline regex sample (equivalent of \z)
body: <p>I am trying to match each section of a string starting with one or more <code>+</code> and ending whenever it finds another instance of it or the end of the sample.</p>
  <p>The sample is the following:</p>
  <pre><code>+ Horizontal Rules
  
  Lorem ipsum
  
  + Lists
  
  Everything about lists
  
  ++ Bulleted Lists
  
  Make a list element by starting a line with an asterisk. To increase the indent put extra spaces
  before the asterisk.
  
  + Another title
  
  content
  </code></pre>
  <p>The regex I'm currently using (<code>/^(\++) (.*?)(?=^\++)/gms</code>) will split the sample into different matches. But in this case, the last section isn't matched, since the look-ahead doesn't find anything:</p>
  <pre><code>+ Another title
  
  content
  </code></pre>
  <p>I tried using <code>\z</code>, which is supposed to match the end of the sample in a multiline regex :</p>
  <pre><code>^(\++) (.*?)(?=^\++|\z)
  </code></pre>
  <p>But unfortunately, the JavaScript regex engines haven't implemented this basic feature, making it look for a literal <code>z</code> instead.</p>
  <p>Is there any way to replicate <code>\z</code> behavior ?</p>
  <p>I've tried the following regex without any concrete results : <code>^(\+)+ (.*?)(?=^\++)|(?:$(?!.*))</code></p>