fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var text = "Quick \"brown fox jumps \"over\" the lazy\" dog";
  9. var res = Regex.Replace(text, "(?<=^[^\"]*)\"|\"(?=[^\"]*$)", "\"\"\"");
  10. Console.WriteLine(res);
  11. }
  12. }
Success #stdin #stdout 0.07s 34032KB
stdin
Standard input is empty
stdout
Quick """brown fox jumps "over" the lazy""" dog