I'm aware of how UBBT parses URLs thanks. It shouldn't matter if you use ereg or preg, they both accept Perl-compatible regular expressions. Obviously [:alnum:] won't work but that's just shorthand for [A-Za-z0-9]. Not to do your job for you or anything but here you go. Excuse me if it's not perfect, I threw it together in 5 minutes but it clearly demonstrates that this is possible:
$string = "Check out this link: http://www.someurl.com/i,have,commas.html.";
$pattern = "/(((ftps?|https?):\/\/)*(www\.)[^ \t\n<]*([A-Za-z0-9]|#))/i";
$replacement = "<a href=\"$1\">$1</a>";
echo preg_replace($pattern, $replacement, $string);
Now am I going to get banned again for my trouble or what?