I am trying to extract .com, .net and .org links from a single webpage that contains various numbers of these. I am just learning about Regex using C#, but I am not sure how to setup a pattern that looks for the just .com, .net and .org extensions. Then print those urls with those endings. Any suggestions or websites that you can direct me to help me would be great.
here is what i got so far
WebClient client = new WebClient();
string extPattern = @"?.com|?.net|?.org; //but i think i am not doing this right.
string source = client.DounloadString(url) //read the Url and store the pages.
//then not sure what to do.
Thanks
Try this regex:
Anyway this is not the perfect way to achieve your goal because url are very different (could have http or https, with or without www).