I don't entirely understand what you are trying to do but maybe this will help... :shrug:
Code:
$links = '<a rel="nofollow" href="http://www.google.com/" id="extra">google</a>\r\n';
$links .= '<a rel="nofollow" href="http://www.yahoo.com/" id="extra">yahoo</a>\r\n';
$links .= '<a rel="nofollow" href=\'http://www.msn.com/\' id="extra">msn</a>\r\n';
$links .= '<a href="http://www.bing.com/" id="extra">bing</a>\r\n';
$links .= '<a href="http://www.ask.com/" id="extra">ask</a>\r\n';
$uri = 'www.bing.com';
$back = 'bing';
preg_match_all("/<a\s[^>]*href=([\"\']??)(http:\/\/{$uri}*?)([\"\']??)[^>]*>({$back})<\/a>/siU", $links, $matches);
print_r( $matches );