I know what you want. From the preg_replace notes at php.net:
1.
function insert_links($tmpstr) {
return preg_replace('/[\s](http:\/\/[^\s]+)/','<A
href="\0">\0</A>',$tmpstr);
}
2.
$link =
preg_replace("/\b((http(s?):\/\/)|(www.))([\w.]+)([\/\w+.]+)\b/i",
"<a href=\"http$3://$4$5$6\"
target=\"_blank\">$2$4$5$6</a>", $link);
3.
$url =
preg_replace("/([URL=)(http|https|ftp)(:\/\/\S+)(])(.+?)([\/URL])/"
, "<a href=\"\2\3\">\5
target=\"_blank\"</a>" , $url);