您现在的位置是:网站首页> 编程资料编程资料

asp下去除超链接的函数_应用技巧_

2023-05-25 210人已围观

简介 asp下去除超链接的函数_应用技巧_

复制代码 代码如下:

<%
Function ReplaceUrl2(HTMLstr)
Dim n,str1,str2,str3,str4
HTMLstr = Lcase(HTMLstr)
For n=1 to Ubound(Split(HTMLstr,"str1 = Instr(HTMLstr,"str2 = Instr(str1,HTMLstr,">")
HTMLstr = left(HTMLstr,str1-1)&right(HTMLstr,len(HTMLstr)-len(left(HTMLstr,str2)))
HTMLstr = replace (HTMLstr,"","")
ReplaceUrl2 = HTMLstr
Next
End Function
%>


正则表达式去除链接:

复制代码 代码如下:

Function RegRemoveHref(HTMLstr)
Set ra = New RegExp
ra.IgnoreCase = True
ra.Global = True
ra.Pattern = "]+>(.+?)<\/A>"
RegRemoveHref = ra.replace(HTMLstr,"$1")
END Function
您可能感兴趣的文章:

-六神源码网