title: PHP using preg_match to get title from article
body: <p>I am having a strange problem with preg_match. I am using a regular expression that grabs the title of an article, basically looks for the  tag:</p>
  
  <pre><code>preg_match('#(\&lt;title.*?\&gt;)(\n*\r*.+\n*\r*)(\&lt;\/title.*?\&gt;)#', $data, $matches)
  </code></pre>
  
  <p>When I print out the $matches array I get nothing. But when I try the same thing in a regular expression tester, it works fine. I have even tried putting in a string that would definitely match it in place of the $data variable, without any luck.</p>
  
  <p>What am I doing wrong here?</p>