using System.Text.RegularExpressions;
using System.Collections.Generic;
public static void Main()
var values = new Dictionary<string, string>();
values.Add("Value1","1");values.Add("Value2","example2");
var templates = new Dictionary<string, string>
{ "Key2", "Constant with {Value2}" }
var ans = templates.ToDictionary(kv => kv.Key, kv => kv.Value.Expand(values));
public static class ExpandExt
static Regex varPattern = new Regex(@"{(?<var>\w+)}", RegexOptions.Compiled);
public static string Expand(this string src, Dictionary<string, string> vals) => varPattern.Replace(src, m => vals.TryGetValue(m.Groups[1].Value, out var v) ? v : m.Value);