title: Unexpected Output of .match() and regex
body: <p>I am using <code>match()</code> and <code>regex</code> to receive an array of all occurrences of "Name". Name can be any string and is just a placeholder for this example.</p>
  
  <p>As you can see in the first two iterations I receive the expected output. The third iteration however ignores the first <code>\n</code> and also outputs the previous line.</p>
  
  <p>Any ideas why this happens?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#shortDescTextarea").on('keyup', function() {
    var currentVal = $(this).val();
    var allItemNames = currentVal.match(/\n[^:]+:/g);
  
    console.log(allItemNames);
  
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>textarea{height:250px;width:500px;}</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;textarea id="shortDescTextarea" class="form-control"&gt;|H|Header|/H|
  Name: Value
  Name: Value
  |H|Header|/H|
  Name:
  &lt;/textarea&gt;</code></pre>
  </div>
  </div>
  </p>