title: Regex capture everything between two tags across multiple lines
body: <p>I have this regex in Ruby: <a href="http://rubular.com/r/eu9LOQxfTj" rel="nofollow">http://rubular.com/r/eu9LOQxfTj</a></p>
  
  <pre><code>/&lt;sometag&gt;(.*?)&lt;\/sometag&gt;/im
  </code></pre>
  
  <p>And it successfully matches input like this:</p>
  
  <pre><code>&lt;sometag&gt;
    123
    456
  &lt;/sometag&gt;
  </code></pre>
  
  <p>Which would return</p>
  
  <pre><code>123
  456
  </code></pre>
  
  <p>However, when I try this in javascript (testing in chrome), it doesn't match anything.
  Does javascript's multiline flag mean something else? </p>
  
  <p>I want to capture everything non-greedily between two given tags.
  How can I accomplish this in javascript using regex? Here is a <a href="https://www.debuggex.com/r/aL3bsTjI2E01S44F" rel="nofollow">Debuggex Demo</a></p>
  
  <pre><code>&lt;sometag&gt;(.*?)&lt;\/sometag&gt;
  </code></pre>
  
  <p><img src="https://www.debuggex.com/i/aL3bsTjI2E01S44F.png" alt="Regular expression visualization"></p>
  
  <p>This is not XML parsing.</p>