fork(3) 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 input = @"My name @is ,Wan.;'; Wan";
  12. var chrs = new[] {'@', ',', '.', ';', '\''};
  13. var pattern = $"[{Regex.Escape(new string(chrs))}]+";
  14. Console.WriteLine(pattern);
  15. var result = Regex.Replace(input, pattern, string.Empty);
  16. Console.Write(result);
  17. }
  18. }
Success #stdin #stdout 0.03s 134720KB
stdin
Standard input is empty
stdout
[@,\.;']+
My name is Wan Wan