差出人:https ://stackoverflow.com/a/959982/101055
私は使用しようとしています:
using System.Text.RegularExpressions;
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("goodName1", "asdf");
parameters.Add("goodName2", "qwerty");
string text = "this is my {goodName1} template {goodName2} string";
text = Regex.Replace(text, "\{(.+?)\}", m => parameters[m.Groups[1].Value]);
\{(.+?)\}
、on {
、および}
正確に2つのビルドエラーが発生します。
エラー>認識されないエスケープシーケンス
ここで何が問題になっていますか?