fork download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var s = "\"I & my friends are stuck here\", & we can't resolve";
  10. Console.WriteLine(
  11. Regex.Replace(s, "\"[^\"]*\"", m => Regex.Replace(m.Value, @"\B&\B", "and"))
  12. );
  13. }
  14. }
Success #stdin #stdout 0.03s 134592KB
stdin
Standard input is empty
stdout
"I and my friends are stuck here", & we can't resolve