Skip to content

Instantly share code, notes, and snippets.

@ElemarJR
Created August 1, 2012 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ElemarJR/3226611 to your computer and use it in GitHub Desktop.
Save ElemarJR/3226611 to your computer and use it in GitHub Desktop.
public void PrintLinksFromMSDNWithTasks()
{
Task.Factory.StartNew(
() => new WebClient().DownloadString("http://msdn.microsoft.com/pt-br/")
).ContinueWith(e =>
{
var regex = "href\\s*=\\s*(?:\"(?[^\"]*)\"|(?\\S+))";
var matches = Regex.Matches(e.Result, regex);
foreach (Match match in matches)
Console.WriteLine(match.Groups[1]);
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment