If you need any and all attributes of the <a> tag use:
$string = '<a class="link interlink" rel="&content_type=topic&content_type_id=21579" href="http://www.associatedcontent.com/topic/21579/fannie_mae.html" title="Fannie Mae" onClick="var s=s_gi(\'assoccontdev\');
s.tl(this,\'o\',\'art_interlink\');
if(s.prop20) s.prop30=s.prop20;
if(s.prop29) s.prop31=s.prop29;
s.linkTrackVars=\'prop30,prop31\'; ">Fannie Mae</a>';
$regex = '~<a(.*)>(.*)</a>~iUs';
preg_match($regex, $string, $matches);
$linkTitle = $matches[2];
$regex2 = '~(.*)="(.*)"~iUs';
preg_match_all($regex2, $matches[1], $matches);
for($i=0; $i<sizeof($matches[1]); $i++)
{
echo '<strong>'.$matches[1][$i].'</strong>: <pre>'.htmlspecialchars($matches[2][$i]).'</pre>';
}
If you only want href and the value of the <a> tag use:
<?php
$string = '<a class="link interlink" rel="&content_type=topic&content_type_id=21579" href="http://www.associatedcontent.com/topic/21579/fannie_mae.html" title="Fannie Mae" onClick="var s=s_gi(\'assoccontdev\');
s.tl(this,\'o\',\'art_interlink\');
if(s.prop20) s.prop30=s.prop20;
if(s.prop29) s.prop31=s.prop29;
s.linkTrackVars=\'prop30,prop31\'; ">Fannie Mae</a>';
$regex = '~<a.*href="(.*)".*>(.*)</a>~iUs';
preg_match($regex, $string, $matches);
$href = $matches[1];
$linkTitle = $matches[2];
echo $href.'<br />'.$linkTitle;
Of course, there's always the use of simpleXML if you can use it 😉