title: Regex to match content of HTML body in PHP
body: <p>I need a regex in php for matching contents between tags of an element, e.g. <code>&lt;body&gt;</code> and <code>&lt;/body&gt;</code> with the perl compatible <code>preg_match</code>.</p>
  
  <p>So far I tried with:</p>
  
  <pre><code>// $content is a string with html content
  
  preg_match("/&lt;body(.|\r\n)*\/body&gt;/", $content, $matches);
  
  print_r($matches);
  </code></pre>
  
  <p>…but the printout is an empty array.</p>