Given URLs of the form:
http://www.example.com
http://www.example.com/
http://www.example.net (any third-level domain, .net, .co.uk, etc.)
http://www.example.com/example.html?a=1&b=2
http://www2.example.com (any sub-domain)
http://example.com (no sub-domain)
I need some help with code that uses a Regular Expression to extract just the
second-level domain "example.com" from all forms of the full URL.
Code should take a URL as input and give second-level domain
"example.com" as output.