title: javascript regex match the string excluding ending pattern
body: <p>Can anyone please help me with this:</p>
  
  <p>I'm stuck with JS regular expression. </p>
  
  <p>I have a string like:</p>
  
  <blockquote>
    <blockquote>
      <p>idont<strong>test</strong>33lkjrhguegh8438934hihfer<strong>TEST2</strong>oidchschds</p>
    </blockquote>
  </blockquote>
  
  <p>I want to match everything between <code>test</code> and <code>TEST2</code> excluding <code>TEST2</code>.</p>
  
  <p>So the expected output would be:</p>
  
  <blockquote>
    <blockquote>
      <p><strong>test</strong>33lkjrhguegh8438934hihfer</p>
    </blockquote>
  </blockquote>
  
  <p>I've tried the following with no success :( :</p>
  
  <pre><code>(test)(.*)(?:(?!(TEST2)))
  (test)(.*)(?:(TEST2))
  (test)(.*)(?:(?!TEST2))
  (test)(.*)(?:TEST2)
  (test)(.*)(TEST2) //almost works but selects TEST2 also
  </code></pre>