日期:2014-05-17 浏览次数:21237 次
<%
Function Removehtml(Strhtml,reg)
Dim Objregexp, Match, Matches
Set Objregexp = New Regexp
Objregexp.Ignorecase = True
Objregexp.Global = True
Objregexp.Pattern = reg
Set Matches = Objregexp.Execute(Strhtml)
For Each Match In Matches
Strhtml=Replace(Strhtml,Match.Value,"")
Next
Removehtml=Strhtml
Set Objregexp = Nothing
End Function
dim str
str="<IMG src=""../UploadFile/200541821112564.gif"" border=0>测试一<br/>下效<p>果</p>!"
Response.write Removehtml(str,"<img.+?>")
Response.write Removehtml(str,"<.+?>") '过滤所有html标签
%>