fork(28) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var rx = new Regex("([^=\\s]+)='([^']*)'");
  9. var str = "key1='value1' key2='value 2' key3='value3' key4='value4' key5='5555' key6='xxx666'";
  10. foreach (Match m in rx.Matches(str)) {
  11. Console.WriteLine("{0} {1}", m.Groups[1], m.Groups[2]);
  12. }
  13. }
  14. }
Success #stdin #stdout 0.07s 34064KB
stdin
Standard input is empty
stdout
key1 value1
key2 value 2
key3 value3
key4 value4
key5 5555
key6 xxx666