[Apologies; I mistyped. This a solution to your problem. Basically, ereg is the problem, because it doesn't do ungreedy matching. Weedpacket].
function FormatNewsForDisplay($news)
{
$news = stripslashes($news);
if (strpos("[link=", $news)!==false )
{
preg_match("/\[link=.+?\].+?\[link\]/s", $news, $middle);
$middle = preg_replace("/\[link=.+?\]|\[link\]/s", "", $middle[0]);
$link = preg_replace("/\[link=|\].+?\[link\]/s", "", $news);
$news = preg_replace("#[a-z]+://[^<>\s]+[\da-z/]#is", "<a href=\"\0\" target=\"\0\">$middle</a>", $link);
}
return $news;
}