内容摘要:
%FunctionReplaceUrl2(HTMLstr)Dimn,str1,str2,str3,str4HTMLstr=Lcase(HTMLstr)Forn=1toUbound(Split(HTMLstr,'a'))str1=Instr(HTMLstr,'a')str2=Instr(str1,HTMLstr,'')HTMLstr=left(HTMLstr,......
|
<%
FunctionReplaceUrl2(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>","")
ReplaceUrl2=HTMLstr
Next
EndFunction
%>
正则表达式去除链接:
代码如下:
FunctionRegRemoveHref(HTMLstr)
Setra=NewRegExp
ra.IgnoreCase=True
ra.Global=True
ra.Pattern="<A[^>]+>(.+?)<\/A>"
RegRemoveHref=ra.replace(HTMLstr,"$1")
ENDFunction
|