fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string pattern = @"(?<=Top Pay\D*)\d+(?:,\d+)*";
  9. string input = @"Top Pay: 1,000,000
  10. Top Pay: 888,888";
  11. RegexOptions options = RegexOptions.IgnoreCase;
  12.  
  13. foreach (Match m in Regex.Matches(input, pattern, options))
  14. {
  15. var topPayMatch = int.Parse(m.Value, System.Globalization.NumberStyles.AllowThousands);
  16. Console.WriteLine(topPayMatch);
  17. }
  18. }
  19. }
Success #stdin #stdout 0.07s 27352KB
stdin
Standard input is empty
stdout
1000000
888888