title: Non-terminating RegExp.exec in Rhino
body: <p>I have the following JavaScript program saved in a file <code>pre.js</code>:</p>
  
  <pre><code>var pre = readFile("method-help.html");
  RegExp.multiline = true;
  print(/&lt;pre&gt;((?:.|\s)+)&lt;\/pre&gt;/.exec(pre)[1]);
  </code></pre>
  
  <p>The contents of <code>method-help.html</code> is simply the page at <a href="http://api.stackoverflow.com/1.0/help/method?method=answers/%7bid%7d" rel="nofollow noreferrer">http://api.stackoverflow.com/1.0/help/method?method=answers/%7bid%7d</a>.  What I'm trying to do is get the JSON code in between the <code>pre</code> tags.  However, when I run the program in Rhino, nothing is printed out and the program does not terminate.  The command I use is:</p>
  
  <pre><code>java -jar js.jar pre.js
  </code></pre>
  
  <p>My Rhino version is 1_7R2.</p>