using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Linq; public class Test { public static void Main() { var s = "{{value1}} {{value2}}"; var results = Regex.Matches(s, @"{{(\w+)}}") .Cast() .Select(x => x.Groups[1].Value) .ToList(); foreach (var str in results) { Console.WriteLine(string.Join("\n", results)); } } }