I think you mean a regex expression to search raw html for links, something like this:
<?php
$rawhtml="<body><h1>Heading</h1><h3>The <a href='www.google.com'>link</a> goes to google</h3><h2>but <a href='nowhere.org' class='link'>this</a> doesn't</h2></body>"; //example
$pattern="|<a.*?>.*?</a>|";
if (preg_match_all($pattern, $rawhtml, $match)) { //if match:
//list matches or whatever: $matches[0][0], $matches[0][1] etc
}
?>
Edit:
----
Here is something a bit better:
<?php
$rawhtml='<body><h1>Heading</h1><h3>The <a href="http://www.google.com">link</a> goes to google</h3><h2>and <a class="link" href="http://second.com">this one</a> goes elsewhere!</h2><a id="id" class="heavy" href="http://www.large.com" name="what?" attr="nowt">big</a></body>'; //example
$pattern='!(<a(.*?)?href=("|\')(.*?)("|\')(.*?)>(.*?)</a>)!';
echo "String:<br/><textarea name='raw' rows='5' cols='100'>$rawhtml</textarea><br/>";
echo "Pattern:<textarea rows='1' cols='90'>$pattern</textarea><br/>";
if (preg_match_all($pattern, $rawhtml, $match)) {
echo "Result:<br/>";
echo "<table border='1' cellpadding='3px'> <tr><td>Title</td><td>Link</td><td>Attributes</td></tr>";
foreach($match as $k=>$v) {
echo "<tr><td>".$match[7][$k]."</td><td><a href='".$match[4][$k]."'>".$match[4][$k]."</a></td><td>".$match[2][$k].$match[6][$k]."</td></tr>";
}
echo "</table><textarea rows='17' cols='100'><br/>Array:";
print_r($match);
echo "</textarea>";
} else {echo "No Match";}
?>
The above will take any html input and output only the link data, in a nice little table, including other attributes if necessary. Try it out! Come on you know that's worth the credits! Took me over an hour to come up with the regex pattern!