$mess=preg_replace("!(https?|ftp)://(.*?)(){1,}!ise", "'<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>\\3'", $mess);