fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var s = "f20s30t";
  12. var m = Regex.Match(s, @"^([fst])(\d+[fst])*$");
  13. if (m.Success)
  14. {
  15. Console.WriteLine(m.Groups[1].Value);
  16. foreach (var g in m.Groups[2].Captures.Cast<Capture>().Select(t => t.Value))
  17. Console.WriteLine(g);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.08s 20496KB
stdin
Standard input is empty
stdout
f
20s
30t