fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. var s = "PH/2400310945 01.09.21 WARRANTY2021091D 19307.92- 0 -19,307.92";
  8. var result = System.Text.RegularExpressions.Regex.Match(s, @" -?\d+(?:,\d{3})*(?:\.\d{2})?$").Value;
  9. Console.WriteLine(result);
  10. }
  11. }
Success #stdin #stdout 0.12s 29364KB
stdin
Standard input is empty
stdout
 -19,307.92