title: How to match everything before constant string using RegExp in Google Apps Script?
body: <p>I'm going insane.</p>
  <p>I need to do the following:</p>
  <p>Given a string <code>&quot;sometext&lt;tag&gt;&quot;</code>, I nee to extract <code>&quot;sometext&quot;</code> from that. Now I have two solutions that work in the Firefox console but not in Google Apps script (could use exec or match):</p>
  <pre><code>(A) string.match(/(^.*?)&lt;[^&lt;]*?&gt;/)
  (B) string.match(/^.*?(?=&lt;[^&lt;]*?&gt;)/)
  </code></pre>
  <p>Now I read a lot of stackoverflow answers on similar things and in some they say that lookahead is not supported. Fine. That's why I came up with the capturing group one.</p>
  <p>Works like a charm in the console but execute it in GAS and it returns null. WTF??</p>
  <p>Why is this happening? Does GAS also not support capturing groups?? Any ideas on how to achieve my goal?</p>
  <p>Thank you for your time!</p>