Snetty
01-17-2008, 05:40 PM
I've used that title before according to my browser.. i have to say i'm not surprised, it's my total nemesis.
Anyway, onto my problem. I have to find out the total number of pages on a website, via regex.
So far I've come up with the following code
if(preg_match("bytransfer\.php\?sltByCap=V&TransferType=GB&sltTransferred=0&sltCapPercent=&Find=Yes&hdnPage=([:digit:])'", $html, $matches)){
sort($match);
$total_pages = $match[count($match)];
echo $total_pages . " pages";
} else {
echo " - pregmatch didn't work";
}
Predictably it gives me a
Warning: preg_match(): Delimiter must not be alphanumeric or backslash in
error message. Could someone tell me where I'm going wrong please, I'd be most grateful.
Anyway, onto my problem. I have to find out the total number of pages on a website, via regex.
So far I've come up with the following code
if(preg_match("bytransfer\.php\?sltByCap=V&TransferType=GB&sltTransferred=0&sltCapPercent=&Find=Yes&hdnPage=([:digit:])'", $html, $matches)){
sort($match);
$total_pages = $match[count($match)];
echo $total_pages . " pages";
} else {
echo " - pregmatch didn't work";
}
Predictably it gives me a
Warning: preg_match(): Delimiter must not be alphanumeric or backslash in
error message. Could someone tell me where I'm going wrong please, I'd be most grateful.