I'm trying to get the domain name from a string. From this URL http://www.tvstore.nl/product/572875/samsung-ue48ju7500.html
I'd like to get www.tvstore.nl as a result. However, with this function I just get www.tvstore. What am I missing? I want this to work for any TLD, whether that's .com, .org, .de, .co etc.
Protected Function ExtractDomainFromURL(ByVal sURL As String) As String
Dim rg As New Regex("://(?<host>([a-z\d][-a-z\d]*[a-z\d]\.)*[a-z][-a-z\d]+[a-z])")
If rg.IsMatch(sURL) Then
Return rg.Match(sURL).Result("${host}")
Else
Return String.Empty
End If
End Function