fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static string test ()
  7. {
  8. string parameters = "one=aa&two=&three=aaa&four=";
  9. string pattern = "(?:^|&)[a-zA-Z]+=(?=&|$)";
  10. string replacement = "";
  11. Regex rgx = new Regex(pattern);
  12. string result = rgx.Replace(parameters, replacement);
  13.  
  14. return result;
  15. }
  16. public static void Main()
  17. {
  18. Console.WriteLine(test());
  19. }
  20. }
Success #stdin #stdout 0.07s 20024KB
stdin
Standard input is empty
stdout
one=aa&three=aaa