I've been toying with my regex for a while and still has some problem with this.
I would like to get the web hostname of URLs : "get_domain(url) ":
http://yahoo.com --> yahoo.com
http://www.yahoo.com/ --> www.yahoo.com
http://www.yahoo.com/cool/dir --> www.yahoo.com
http://sub1.sub2.google.com --> sub1.sub2.google.com
http://sub1.sub2.google.com/abc/def/aa?? --> sub1.sub2.google.com
I would appreciate any help and pointer. Thanks in advance!!