fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string s = @"/s:http://a...content-available-to-author-only...d.asd /e:device /f:create";
  9.  
  10. string reg1 = @"(?=/s:)[^< ]+";
  11. string reg2 = "(?=/e:)[^< ]+";
  12. string reg3 = "(?=/f:)[^< ]+";
  13.  
  14. Match match1 = Regex.Match(s, reg1, RegexOptions.IgnoreCase);
  15.  
  16. if (match1.Success)
  17. {
  18. string key1 = match1.Groups[0].Value.Substring(3);
  19. Console.WriteLine(key1);
  20. }
  21.  
  22. Match match2 = Regex.Match(s, reg2, RegexOptions.IgnoreCase);
  23.  
  24. if (match2.Success)
  25. {
  26. string key2 = match2.Groups[0].Value.Substring(3);
  27. Console.WriteLine(key2);
  28. }
  29.  
  30. Match match3 = Regex.Match(s, reg3, RegexOptions.IgnoreCase);
  31.  
  32. if (match3.Success)
  33. {
  34. string key3 = match3.Groups[0].Value.Substring(3);
  35. Console.WriteLine(key3);
  36. }
  37. }
  38. }
Success #stdin #stdout 0.07s 34112KB
stdin
Standard input is empty
stdout
http://a...content-available-to-author-only...d.asd
device
create