Поможешь исправить баг?
if (preg_match("~([^\.]*)\.wikipedia\.org/wiki/([^\s]*)~", $path, $strs))
$text = '(wiki/'.$strs[1].') '.$strs[2].$anchor;
if (preg_match("~^(?:www\.)?google\.[^q]*q=([^&\s]*)~", $path.$anchor, $strs))
$text = '(Google) '.$strs[1];//.$anchor;
if (preg_match("~^(?:www\.)?yandex\.[^t]*text=([^&\s]*)~", $path, $strs))
$text = '(Yandex) '.$strs[1].$anchor;