正则表达式收集

1、清除内容中的JavaScript代码

        reg.Pattern ="<SCRIPT[^<]*</SCRIPT>"
        reg.IgnoreCase = true;
        reg.Global = true;
        string retClearJsCode = reg.Replace(sourceCode,"")

2、清除内容中的HTML代码

        reg.Pattern = "<[^>]*>";
        reg.IgnoreCase = true;
        reg.Global = true;
        string retClearHTMLCode = reg.Replace(sourceCode, "");


        
原文地址:https://www.cnblogs.com/songshuqun/p/908235.html