if(preg_match("/(?<!(\[url\]))(?<!(\[url=))((http\:\/\/|www\.)\S*\.(com|co\.uk|info|org|us|tk|gov|mil|net)(\S*)?)(!(\[\/url\]))(!(\]))/i", $string)){$string = preg_replace("/((http\:\/\/|www\.)\S*\.(com|co\.uk|info|org|us|tk|gov|mil|net)(\S*)?)/i", "<a href='$1'>$1</a>", $string);}