title: Match everything inside body tags with regex and javascript
body: <p>I'd like to know if someone can help me with regex on javascript.</p>
  
  <p>So basically I have the following sample of an email body:</p>
  
  <pre><code>&lt;body lang="FR" link="#0563C1" vlink="#954F72"&gt;&lt;div class="WordSection1"&gt;&lt;p style="margin:0cm;margin-bottom:.0001pt"&gt;Bonjour,&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/body&gt;
  </code></pre>
  
  <p>And using regex I need to get only the content between the body tag, how can I do that?</p>
  
  <p>I tried this before (str is the html code above): <code>str.match(/&lt;body\s[^&gt;]*&gt;(.*?)&lt;\/body&gt;/gi);</code></p>
  
  <p>But when I try to get the group 1, using str[1], I always get undefined, any idea why?</p>
  
  <p>Important Note: I'm doing this on ServiceNow and I need to parse the HTML on server side, basically what I have is the HTML code inside a string field.</p>