Hi all i am trying to use preg_match to get number of pages from a html that has this format :



HTML Code:
<div class="pagingOf">of </div><a class="pagingLink" href="javascript:__doPostBack('ctl00$cpMain$UserViewPictureControl$PagerTop','4')">4</a>
in this case i want to grab the number 4 but it never works. Could any one tell me what



PHP Code:
global $curl;

// Retrieve number of pages page.
    
echo 'Checking friends list... ';
    
curl_setopt($curlCURLOPT_URL'./test.html');
    
curl_setopt($curlCURLOPT_POST0);
    
$result curl_exec($curl);
    
$headers curl_getinfo($curl);
    
    
// Find out how many pages there are. 
    
if (preg_match('~of <a href="(.+?)" class="pagingLink">([0-9]+)</a>~'$result$matches))
    {
        
$pages $matches[2];
            echo 
' Number of pages: $pages ';
        unset(
$matches);
        
    }