I use this to grab links
$start="href=\"";
$end="\"";
eregi("$start(.*)$end", $line, $out)
if you parse the file line by line this will give you all the strings beginning with href=, be carful though, if you have multiple urls on a line this won't work, also, doing eregi in this way will grab a line till the last ", so probably you will have to wok on the string a little more to make it work perfectly