in reply to Parsing out URLs with regex

Amongst the other issues already pointed out by fellow monks, I saw no mention yet of the gravest error here:
Don't use $1 unless you are absolutely sure the match succeeded.
Definitely bad code here.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.