Hey i'm curious as to how to parse out the host name in a URL using regular expressions in C#.
i have the following regex:
Regex regexUrl = new Regex("://(?<host>([a-z\\d][-a-z\\d]*[a-z\\d]\\.)*[a-z][-a-z\\d]+[a-z])");
but it throws an error when the URL does not contain a "http://", and it also does not parse out the "www." part of the url.
So how would i code a function that parses out the "hostname.com" from a URL, even if it does not contain a "http://". Thanks :)