fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var pat = @"^(?:""([^""]+)"")?.*?(0+)$";
  9. var match = Regex.Match("#.##0.00", pat);
  10. if (match.Success) {
  11. Console.WriteLine(match.Groups[1].Value + match.Groups[2].Length.ToString());
  12. }
  13. var match2 = Regex.Match("\"$\"#,##0.0000", pat);
  14. if (match2.Success) {
  15. Console.WriteLine(match2.Groups[1].Value + match2.Groups[2].Length.ToString());
  16. }
  17.  
  18.  
  19. }
  20. }
Success #stdin #stdout 0.11s 24896KB
stdin
Standard input is empty
stdout
2
$4