# perl s{%(\w+)%}{$hash{$1}}g // C# Regex.Replace(s, @"%(\w+)%", new MatchEvaluator( hashLookup ) );