<%
'*********************************
'Function: RemoveHref_A(HTMLstr)
'Arguments: HTMLstr, string to be removed
'Author: Alixi
'Date: 2007/7/12
'Description: Remove all hyperlinks in the string
'Example: <%=RemoveHref_A("<ahref=/abc/h.html>test</a>")%>
'*********************************
FunctionRemoveHref_A(HTMLstr)
Dimn, str1, str2, str3, str4
HTMLstr=Lcase(HTMLstr)
Forn=1toUbound(Split(HTMLstr,"<a"))
str1=Instr(HTMLstr,"<a")
str2=Instr(str1,HTMLstr,">")
HTMLstr=left(HTMLstr,str1-1)&right(HTMLstr,len(HTMLstr)-len(left(HTMLstr,str2)))
HTMLstr=replace(HTMLstr,"</a>","")
RemoveHref_A=HTMLstr
Next
EndFunction
%>
Regularly remove all hyperlinks in strings
<%
'*********************************
'Function: RegRemoveHref(HTMLstr)
'Arguments: HTMLstr, string to be removed
'Author: Alixi
'Date: 2007/7/12
'Description: Remove all hyperlinks in strings by regular
'Example: <%=RegRemoveHref("<ahref=/abc/h.html>test</a>")%>
'*********************************
FunctionRegRemoveHref(HTMLstr)
Setra=NewRegExp
ra.IgnoreCase=True
ra.Global=True
ra.Pattern="<a[^>]+>(.+?)<//a>"
RegRemoveHref=ra.replace(HTMLstr,"$1")
ENDFunction
%>