this works with vbTag URL.
"|\[ url=(.*)\](.*)\[ /url\]|i","|\[ url\](.*)\[/ url\]|i",
and this replace
"<a href=\"\\1\" class=\"uLink\" target=\"_blank\">\\2</a>","<a href=\"\\1\" class=\"uLink\" target=\"_blank\">\\1</a>"
you can use this regular expression:
function checkurl($txt){
$search = array(
"|(https?)([^\s]+)|is",
"|[^([url]http://[/url])](w{3}[^\s]+)|is"
);
$replace = array(
" <a href=\"\\1\\2\">\\1\\2</a>",
" <a href=\"http://\\1\">\\1</a>"
);
$txt = preg_replace($search,$replace,$txt);
return $txt;
}
try it 😉