fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Demo {
  5. public static void Main()
  6. {
  7. string delimiter = "||";
  8. string keyValues = "CustomerId=1||OrderId=12||UserId=a1dcd568-f129-419b-b51e-be2dbb67de0f";
  9. string pattern = @"(?<=^|" + Regex.Escape(delimiter) + @")\w+(?==)";
  10. foreach (var key in Regex.Matches(keyValues, pattern))
  11. Console.WriteLine(key);
  12. }
  13. }
Success #stdin #stdout 0.06s 34080KB
stdin
Standard input is empty
stdout
CustomerId
OrderId
UserId