fork download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var re = @"\d{1,3}(?:\.\d{3})+(?:,\d{2})?";
  9. var str = "values 5.000,00, 2.699.230,20, 1.000.000,00, etc. 999,99 including 18, 1.0, 1.5.2, 8854, etc";
  10. var res = Regex.Matches(str, re)
  11. .Cast<Match>()
  12. .Select(p => p.Value)
  13. .ToList();
  14. Console.WriteLine(string.Join("\n", res));
  15. }
  16. }
Success #stdin #stdout 0.03s 30704KB
stdin
Standard input is empty
stdout
5.000,00
2.699.230,20
1.000.000,00