fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var text = "some words....3,50000 - 11,0 .... text....";
  10. var match = Regex.Match(text, @"(\d+(?:,\d+)?)\s*-\s*(\d+(?:,\d+)*)");
  11.  
  12. if (match.Success)
  13. {
  14. Console.WriteLine("{0} - first number", match.Groups[1].Value);
  15. Console.WriteLine("{0} - second number", match.Groups[2].Value);
  16. }
  17. }
  18. }
Success #stdin #stdout 0.07s 29228KB
stdin
Standard input is empty
stdout
3,50000 - first number
11,0 - second number