// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; using System.Text.RegularExpressions; namespace E { public class Program { private static readonly Regex re = new Regex(@"]*href\s*=\s*[""']([^""']*)[""'][^>]*>", RegexOptions.Compiled | RegexOptions.IgnoreCase); public static List LinkParse(string html) { List res = new List(); foreach(Match m in re.Matches(html)) { res.Add(m.Groups[1].Value); } return res; } public static void Main(string[] args) { string html = "bla bla bla bla bla bla"; List links = LinkParse(html); foreach(string link in links) { Console.WriteLine(link); } } } }