// 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.Text.RegularExpressions; namespace E { public class Program { private static Regex re = new Regex(@"(?:]+href\s*=\s*[""'])([^""']*)(?:[""'][^>]+title\s*=\s*[""'])([^""']*)(?:[""'][^>]*>)([^<]*)(?:)", RegexOptions.IgnoreCase); public static void Find(string html) { foreach(Match m in re.Matches(html)) { Console.WriteLine("link=" + m.Groups[1].Value); Console.WriteLine("title=" + m.Groups[2].Value); Console.WriteLine("text=" + m.Groups[3].Value); } } public static void Main(string[] args) { Find("bla Foo bla Bar bla"); } } }