fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var email = "2011,01,10 a,john.doe@gimail.com";
  9. string result;
  10. string pattern = "gimail\\.";
  11. string replacment = "gmail.";
  12.  
  13. Regex rgx = new Regex(pattern);
  14.  
  15. email= rgx.Replace(email, replacment);
  16.  
  17. pattern = @"(?<=\p{L}),";
  18. replacment = ".";
  19.  
  20. rgx = new Regex(pattern);
  21. result = rgx.Replace(email, replacment);
  22. Console.WriteLine(result);
  23. }
  24. }
Success #stdin #stdout 0.08s 19816KB
stdin
Standard input is empty
stdout
2011,01,10   a.john.doe@gmail.com