fork(1) 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 text = "Top Rate: 8 88,888 and Top Rate: 8 \n 88,888";
  12. var results = Regex.Matches(text, @"\bTop Rate\b.*?(\d(?:[\d,.\s]*\d)?)", RegexOptions.Singleline)
  13. .Cast<Match>()
  14. .Select(x => new string(x.Groups[1].Value.Where(c => char.IsDigit(c)).ToArray()));
  15. foreach (var s in results)
  16. {
  17. Console.WriteLine( s );
  18. }
  19. }
  20. }
Success #stdin #stdout 0.07s 30664KB
stdin
Standard input is empty
stdout
888888
888888