Hmm... didn't we do one of these before?
$var="<p> <a href=hello.html>hello</a> ";
preg_match("/<p>[^<]*<a[^>]*?href=\"?(.*?)(>|\"| )/i", $var, $match);
echo $match[1]."\n";
Okay, this will match a line which has a "<p>" then any characters except a "<" until it hits a "<a". It will ignore any class, onmouseover, etc attributes and match against href= with or without the beginning quote. Grabs the url stopping at either an end quote, a space, or the end of the anchor tag.