in reply to Re^3: Extracting a domain name from a url
in thread Extracting a domain name from a url

You code fails with the input you gave it. Furthermore, it doesn't work with the other example in the post to which you replied either.

http://proxy.aol.com:8080/ gives proxy.aol.com:8080 instead of proxy.aol.com.

http://user:pass@yahoo.com/login gives user:pass@yahoo.com instead of yahoo.com