javascript|正则
function StripHtml(html)
...{
html = html || "";
var scriptregex = "<scr" + "ipt[^>.]*>[sS]*?</sc" + "ript>";
var scripts = new RegExp(scriptregex, "gim");
html = html.replace(scripts, " ");
//Stripts the <style> tags from the html
var styleregex = "<style[^>.]*>[sS]*?</style>";
var styles = new RegExp(styleregex , "gim");
html = html.replace(styles, " ");
//Strips the HTML tags from the html
var objRegExp = new RegExp("<(.| )+?>", "gim");
var strOutput = html.replace(objRegExp, " ");
//Replace all < and > with < and >
strOutput = strOutput.replace(/</, "<");
strOutput = strOutput.replace(/>/, ">");
objRegExp = null;
return strOutput;
}