$url = "http://www.myweb.com/index.html?sfjlkkljl=sfsda"

I want host as "http://www.myweb.com"

same should work for other protocol (like ftp etc ) too.

Can someone provide the regular expression in perl (without using URI:URL package)

thanks.