fork 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 test = $"6/4/2020,test,test,testJR,\"111 test DRIVE, city, st\",city,st,11111,test@gmail.com,11111,11111,\"$370,000.00 \",\"$500,000.00 \",Single Family Residence,\"$370,000.00 \",4.25%,Fixed,74.00%,Rate and Term,0.00%,$0.00 ,Good,No";
  12. var regex = new Regex(@"""\s*\$\d+(?:,\d+)*(?:\.\d+)?\s*""|(""[^""]*"")");
  13. test = regex.Replace(test, m => m.Groups[1].Success ? m.Groups[1].Value.Replace(',', ' ') : m.Value);
  14. Console.WriteLine(test);
  15. }
  16. }
Success #stdin #stdout 0.09s 21340KB
stdin
Standard input is empty
stdout
6/4/2020,test,test,testJR,"111 test DRIVE  city  st",city,st,11111,test@gmail.com,11111,11111,"$370,000.00 ","$500,000.00 ",Single Family Residence,"$370,000.00 ",4.25%,Fixed,74.00%,Rate and Term,0.00%,$0.00 ,Good,No