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