PHP regex in simple_html_dom library
<p>I was trying to scrape imdb by following code. </p>

<pre><code>$url = "http://www.imdb.com/search/title?languages=en|1&amp;explore=year";
$html = new simple_html_dom();
$html-&gt;load(str_replace('&amp;nbsp;','',$data = get_data($url)));

foreach($html-&gt;find('#left') as $total_movies)
{
$content = $total_movies-&gt;plaintext;
if(preg_match("/(?&lt;total&gt;[0-9,]+) titles/",$content,$matches))
{
    print_r($matches);
}
echo $content."&lt;br&gt;";
}
</code></pre>

<p>get_data() is just a curl function i created.</p>

<p>The problem is that preg_match is not working. i don't know why but the same thing when used work here. $content contains the text what i scrape in above code.</p>

<pre><code>$content = "1-50 of 101 titles.";
if(preg_match("/(?&lt;total&gt;[0-9,]+) titles/",$content,$matches))
print_r($matches);
</code></pre>
