I'm extracting the host from my url and am getting jammed up by making the last / optional. the regexp needs to be prepared to receive the following:
http://a.b.com:8080/some/path/file.txt
or
ftp://a.b.com:8080/some/path
or
ftp://[email protected]/some/path
or
http://a.b.com
or
a.b.com/some/path
and return a.b.com
so...
(ftp://|http://)? optionally matches the first part
then it gets hairy...
so... without adding ugly (and wrong) regexp here... just in english
(everything that isn't an '@') //optional
(everything that isn't a '/' up to the first '/' IF it's there) //this is the host group that I want
(everything else that trails) //optional