正则有关问题。把所有脚本清除掉。下面为什么有异常?

正则问题。把所有脚本清除掉。下面为什么有错误???
把所有脚本清除掉。下面为什么有错误???


string   str   =   TextBox1.Text;
Regex   r   =   new   Regex(@ " <script[^> ]*> ([.\n]*?) </script[^> ]*> ",RegexOptions.IgnoreCase);
Match   m   =   r.Match(str);
while(m.Success)
{
str   =   str.Replace(m.Groups[0].Value, " ");
m   =   m.NextMatch();
}
TextBox2.Text   =   str;




------解决方案--------------------
你的正则存在的问题还是比较多的,先用下面的试下,看看是否可用,如不可用,哪种情况不可用,给出实例,能够满足你的要求后,再给你解释你的正则为什么有问题吧

<script\s*[^> ]*?> [\s\S]*? </script>