I have a webpage which has nothing on it except some string(s). No images, no background color or anything, just some plain text which is not really that long in length.
WebClient client = new WebClient();
using (Stream data = client.OpenRead(Text))
{
using (StreamReader reader = new StreamReader(data))
{
string content = reader.ReadToEnd();
string pattern = @"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)";
MatchCollection matches = Regex.Matches(content,pattern);
List urls = new List();
foreach (Match match in matches)
{
urls.Add(match.Value);
}
}