$html = preg_replace("/[^\"'=]((http|ftp|https):\/\/[^\s\"']+)/i", "<a href=\"\\1\">\\1</a>", $html);
When the $html input line contains:
Track follow-ups to this story online at http://www.mysite.com/.
the result is that the (url) preceeding blank is gone and that the line-closing dot is in the link, so my output is:
Track follow-ups to this story online athttp://www.mysite.com/.
I just can't get it right. Please help!