using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
var substitutions = new Dictionary<string, string>()
var phrase = "one two three four";
var pattern = string.Join("|", substitutions.Keys.Select(Regex.Escape));
var result = Regex.Replace(phrase, pattern, match => substitutions[match.Value]);
Console.WriteLine(result);