// 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; class MainClass { public static void Main(string[] args) { test("\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "
1a
2bb
3ccc
\n"); } private static void test(string s) { MatchCollection res = Regex.Matches(s,"]*>[\\S\\s]*?"); foreach(Match r in res) { Console.WriteLine("match = " + r.Value); } } }