asp过滤图片

2024-11-22 06:17:07
推荐回答(2个)
回答(1):

<%
str = "adsfad100)this.width=100;"" />"

Dim re, patrn
patrn = "]*([""'])[^""']*\2)*[^""'>]*>"

Set re = New RegExp
re.Pattern = patrn
re.IgnoreCase = True
re.Global = True

str = re.Replace(str, "")

Response.Write str
%>

回答(2):

使用asp的正则表达式
用这个函数过滤
function noHTML(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
're.Pattern="(\<.[^\<]*\>)"
'str=re.replace(str," ")
re.Pattern="(\)"
str=re.replace(str," ")
nohtml=str
set re=nothing
end function