title: Split using RegEx in JavaScript
body: <p>Let's say I have a generalized string </p>
  
  <pre><code>"...&amp;&lt;constant_word&gt;+&lt;random_words_with_random_length&gt;&amp;...&amp;...&amp;..."
  </code></pre>
  
  <p>I would want to split the string using </p>
  
  <pre><code>"&lt;constant_word&gt;+&lt;random_words_with_random_length&gt;&amp;"
  </code></pre>
  
  <p>for which I tried RegEx split like</p>
  
  <pre><code>&lt;string&gt;.split(/&lt;constant_word&gt;.*&amp;/)
  </code></pre>
  
  <p>This RegEx splits till the last '&amp;' unfortunately i.e.</p>
  
  <pre><code>"&lt;constant_word&gt;+&lt;random_words_with_random_length&gt;&amp;...&amp;...&amp;"
  </code></pre>
  
  <p>What would be the RegEx code if I wanted it to split when it gets the first '&amp;'?</p>
  
  <p>example for a string split like</p>
  
  <pre><code>"example&amp;ABC56748393&amp;this&amp;is&amp;a&amp;sample&amp;string".split(/ABC.*&amp;/)
  </code></pre>
  
  <p>gives me</p>
  
  <pre><code>["example&amp;","string"]
  </code></pre>
  
  <p>while what I want is..</p>
  
  <pre><code>["example&amp;","this&amp;is&amp;a&amp;sample&amp;string"]
  </code></pre>