fork download
  1. using System;
  2. using System.IO;
  3. using System.Text.RegularExpressions;
  4. using System.Linq;
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var input = "\"mynamesarealexandandrew\" \"mynameisalexand\"";
  10. var regex = new Regex(@"""[^""\\]*(?:\\.[^""\\]*)*""", RegexOptions.IgnorePatternWhitespace);
  11. var results = regex.Matches(input).Cast<Match>()
  12. .Select(p => p.Value.Replace("we", "")
  13. .Replace("us", "")
  14. .Replace("they", "")
  15. .Replace("and", ""))
  16. .ToList();
  17. foreach (var s in results)
  18. {
  19. Console.WriteLine(s);
  20. }
  21.  
  22. }
  23. }
Success #stdin #stdout 0.11s 24472KB
stdin
Standard input is empty
stdout
"mynamesarealexrew"
"mynameisalex"