Here is a regex that will change
www.google.com to [<a href="http://www.google.com" target="_blank">]
http://www.google.com to [<a href="http://www.google.com" target="_blank">]
and user@host.com to [<a href="mailto:user@host.com">user@host.com</a>]
Hope it is helpful.
$text = preg_replace("#([\n ])([a-z]+?)://([, \n\r]+)#i", "\1<a href=\"\2://\3\" target=\"_blank\">\2://\3</a>", $text); // Link with http
$text = preg_replace("#([\n ])www.([a-z0-9-]+).([a-z0-9-.\~]+)((?:/[, \n\r]*)?)#i", "\1<a href=\"http://www.\2.\3\4\" target=\"_blank\">www.\2.\3\4</a>", $text); // Link without http
$text = preg_replace("#([\n ])([a-z0-9-_.]+?)@([, \n\r]+)#i", "\1<a href=\"mailto:\2@\3\">\2@\3</a>", $text); // E-mail
If for some reason the BB screws the regex, here is a text file with it.
http://www.codegoat.com/help/link-regex.txt