fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.RegularExpressions;
  4. using System.Linq;
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var s = "{{value1}} {{value2}}";
  10. var results = Regex.Matches(s, @"{{(\w+)}}")
  11. .Cast<Match>()
  12. .Select(x => x.Groups[1].Value)
  13. .ToList();
  14. foreach (var str in results)
  15. {
  16. Console.WriteLine(string.Join("\n", results));
  17. }
  18. }
  19. }
Success #stdin #stdout 0.04s 134208KB
stdin
Standard input is empty
stdout
value1
value2
value1
value2