日期:2014-05-18 浏览次数:20434 次
string ss = "<script alsdf>***lsdkjf </script>aaa<script >"; Regex reg = new Regex("<.*?script.*?>", RegexOptions.IgnoreCase); Match m = reg.Match(ss); while (m.Success) { ss = reg.Replace(ss, "[script]"); m = m.NextMatch(); } Console.Write(ss);
------解决方案--------------------
new Regex(@"<script.*?>(.*?)</script>", RegexOptions.Multiline | RegexOptions.IgnoreCase);
这样可以