using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; public class Test { public static void Main() { var s = "f20s30t"; var m = Regex.Match(s, @"^([fst])(\d+[fst])*$"); if (m.Success) { Console.WriteLine(m.Groups[1].Value); foreach (var g in m.Groups[2].Captures.Cast().Select(t => t.Value)) Console.WriteLine(g); } } }