Good point. I've never really encountered this yet, but I'm thinking you just add the 'at' symbol to the second regex match. Instead of:
$text = eregi_replace("(http|https|ftp)://([[:alnum:]/\n+-=%&:_.~?]+[#[:alnum:]+])","<a href=\"\1://\2\">\1://\2</a>",$text);
Change to:
$text = eregi_replace("(http|https|ftp)://([[:alnum:]/\n+-=%&:_.~?@]+[#[:alnum:]+])","<a href=\"\1://\2\">\1://\2</a>",$text);
Other than that, you could just make sure your db entries get slashed prior to entry. That should take care of the problem in the first place, right?