代码如下:
            string aa = "[Fsx.List:ghgfhgfhgffjtttt]kkk[/Fsx.List]";
            Regex reg = new Regex(@"(?is)(?<=\[Fsx\.List:\w+?\]).+?(?=\[/Fsx\.List\])");
            Dictionary<string, string> rules = new Dictionary<string, string>();
            rules.Add("kkk", "22");
            string result = reg.Replace(aa, new MatchEvaluator(m => { return rules.ContainsKey(m.Value) ? rules[m.Value] : m.Value; }));
            Response.Write(result);
            当变量aa= "[Fsx.List:ghgfhgfhgffjtttt]kkk[/Fsx.List]"时可以把kkk替换成22,但当aa = "[Fsx.List:TabelName=admin,IsPage=true,ShowPageNum=true,PageNumAlign=center,Top=8,PageSize=10,OrderField,Num=0,Order=0]kkk[/Fsx.List]"时就不能替换了,还是输出[Fsx.List:TabelName=admin,IsPage=true,ShowPageNum=true,PageNumAlign=center,Top=8,PageSize=10,OrderField,Num=0,Order=0]kkk[/Fsx.List]
请问怎么回事?谢谢!