title: How can I get the body contents out of a variable containing HTML?
body: <p>I have a variable <code>htmlSource</code> containing HTML code like this:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; 
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; 
  &lt;head&gt; 
  &lt;title&gt;IIS 8.0 Detailed Error - 404.0 - Not Found&lt;/title&gt; 
  
  
  &lt;/head&gt; 
  &lt;body&gt;xxx some code here yy&lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>How can I create a new variable <code>htmlBodyOnly</code> that contains only "xxx some code here yy". If possible I would like to do this with a regular expression. I am just not sure how to exclude the start and end using a regex or something similar.</p>
  
  <p>Sorry but I don't have jQuery to use to help. I am working just on a javascript variable. Not working on the DOM.</p>