过滤超级链接的asp函数代码
Function losehref(wstr)
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="
Set Matches =re.Execute(wstr)'开始执行配置
set re=nothing
body=""
For Each Match in Matches
wstr=Replace(wstr,Match.Value,"")
body=wstr
Next
这个正则表达式函数更理想,可以看看:
<%
'ASP过滤所有超链接代码
'ASP编程学习www.zzzyk.com
Function NoHref(sContent)
Dim Re
Set Re=new RegExp
Re.IgnoreCase =True
Re.Global=True
Re.Pattern="])*>"
sContent=Re.Replace(sContent,"")
Re.Pattern="])*>"
sContent=Re.Replace(sContent,"")
NoHref=sContent
Set Re=Nothing
End Function
%>
适当修改还可以过滤其他例如span和javascript<% 'ASP过滤所有超链接代码 'ASP编程学习www.zzzyk.com Function NoHref(sContent) Dim Re Set Re=new RegExp Re.IgnoreCase =True Re.Global=True Re.Pattern="])*>" sContent=Re.Replace(sContent,"") Re.Pattern="])*>" sContent=Re.Replace(sContent,"") NoHref=sContent Set Re=Nothing End Function %>