fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8.  
  9.  
  10. String input = @"Final result 2:1 (1:1, 1:0)";
  11.  
  12. Regex rgx = new Regex(@"(\d+):(\d+)(?= )");
  13.  
  14. foreach (Match m in rgx.Matches(input))
  15. {
  16. Console.WriteLine(m.Groups[1].Value);
  17. Console.WriteLine(m.Groups[2].Value);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.07s 34184KB
stdin
Standard input is empty
stdout
2
1