Tc711Com提示:Asp清除html中style,javascript,css代码 .亲测可用,特别清除复制WORD文件产生的样式代码 |
<%'亲测可用,特别清除复制WORD文件产生的样式代码,QQ:187367103
Function RemoveHTML(str)
Dim objRegExp, Match,strHTML
if isnull(str) then
str=""
end if
strHTML=str
strHTML=replace(replace(replace(strHTML,vblf,""),vbcr,""),vbcrlf,"")
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<script[^>]*?>.*?</script>"
strHTML = objRegExp.Replace(strHTML,"")
objRegExp.Pattern = "<style[^>]*?>.*?</style>"
strHTML = objRegExp.Replace(strHTML,"")
objRegExp.Pattern = "<. ?>"
strHTML = objRegExp.Replace(strHTML,"")
Set objRegExp = Nothing
RemoveHTML=strHTML
End Function
%>
更详细的代码说明: http://bbs.tc711.com/thread-4886-1-1.html
更多的Asp清除html中style,javascript,css代码请到论坛查看: http://BBS.TC711.COM
【 双击滚屏 】 【 评论 】 【 收藏 】 【 打印 】 【 关闭 】
来源:
互联网
日期:2011-5-31