////////////////////////////
string inputstr = "@{AbcD},@{bbbb},@{ABcd}";
string pmType = "@";
string regTxt = (pmType + "\\s*\\{\\s*" + "abcd" + "\\s*\\}").Replace("(", "\\(").Replace(")", "\\)");
//string regTxt = (pmType + "\\s*\\{\\s*" + "aaaa" + "\\s*\\}").Replace("(", "\\(").Replace(")", "\\)");
// string regTxt = @"@\s*\{\s*aaaa\s*\}";
// string regTxt = @"@\s*\{\s*aaaa\s*\}/gi";
inputstr = Regex.Replace(inputstr, regTxt, "CCC", RegexOptions.IgnoreCase | RegexOptions.Compiled);
///////////////
对于小文本不使用 RegexOptions.Compiled;
以上就是【RegexOptions.IgnoreCase正则表达式替换,忽略大小写】的全部内容了,欢迎留言评论进行交流!