I've seen this question posted previously on bytes.com, but the question was never fully answered.
Hypothetically, use this as a URL: http://subdomain1.subdomain2.domain.subdomain3.com What I'm looking for is a way to extract just the domain name leaving the subdomains and any other data excluded.
At any given point, I won't know how many subdomains are included in the URL. So using a regex probably isn't the best idea as...