// 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) { MchCollection res = Regex.Matches(s,"]*>[\\S\\s]*?"); for(int i = 0; i < res.Count; i++) { Console.WriteLine("match " + i + " = " + res[i].Groups[0]); } } }