fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Example
  5. {
  6. public static void Main()
  7. {
  8. string pattern = @"((?:\A|,)""|\G(?!\A))([^""]*)("")(?!,|\Z)";
  9. string substitution = @"$1$2$3$3";
  10. string input = @"something not qualified,""12"" x 12"" something qualified, becuase it has a comma"",this one is not qualified and needs no fixing a 12"" x 12""";
  11.  
  12. Regex regex = new Regex(pattern);
  13. Console.WriteLine(regex.Replace(input, substitution));
  14. }
  15. }
Success #stdin #stdout 0.07s 19740KB
stdin
Standard input is empty
stdout
something not qualified,"12"" x 12"" something qualified, becuase it has a comma",this one is not qualified and needs no fixing a 12" x 12"