fork(24) download
  1. using System;
  2. using System.IO;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var str = "6 cakes 5 donuts 12 muffins";
  10. var rx = new Regex(@"\d+\s+\w+");
  11. var coll = rx.Matches(str);
  12. foreach (Match m in coll)
  13. Console.WriteLine(m.Value);
  14. }
  15. }
Success #stdin #stdout 0.11s 24320KB
stdin
Standard input is empty
stdout
6 cakes
5 donuts
12 muffins