title: regexp in app script return empty result in weird way
body: <p>I have an HTML string and i wrote a simple app script regex</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>const write = console.log // just for the snippet
  
  const short_string = `Total Amount Due:&lt;/td&gt;
  &lt;td&gt;$130.96&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Draft Date:&lt;/td&gt;
  &lt;td&gt;January 21, 2022  &lt;`
  
  var regex= new RegExp('\$([+-]?([0-9]*)(\.([0-9]+))?)','gi');
  var result=regex.exec(short_string);
  write(result);</code></pre>
  </div>
  </div>
  </p>
  <p>why does it return empty result</p>
  <pre><code>[, , , null, null]
  </code></pre>