从MSDN
$ 0-“替换由组号匹配的最后一个子字符串(十进制)。”
在.NET正则表达式中,组0始终是整个匹配项。对于文字$,您需要
string value = Regex.Replace("%PolicyAmount%", "%PolicyAmount%", @"$$0", RegexOptions.IgnoreCase);
从MSDN
$ 0-“替换由组号匹配的最后一个子字符串(十进制)。”
在.NET正则表达式中,组0始终是整个匹配项。对于文字$,您需要
string value = Regex.Replace("%PolicyAmount%", "%PolicyAmount%", @"$$0", RegexOptions.IgnoreCase);