using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
var datamodel = new Dictionary<string, string>();
datamodel.Add("Day", "11");
datamodel.Add("Month", "10");
datamodel.Add("Year", "2022");
var searchRegexPattern = "{Year}/{Month}/{Day}.xls";
var rx = new Regex(@"\{(?<name>.*?)\}");
var result = rx.Replace(searchRegexPattern, new MatchEvaluator(match => {
return datamodel[match.Groups["name"].Value];
Console.WriteLine(result);