asp 去除超链接 asp下去除超链接的函数
人气:0想了解asp下去除超链接的函数的相关内容吗,在本文为您仔细讲解asp 去除超链接的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:超链接,下面大家一起来学习吧。
复制代码 代码如下:
<%
Function ReplaceUrl2(HTMLstr)
Dim n,str1,str2,str3,str4
HTMLstr = Lcase(HTMLstr)
For n=1 to Ubound(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
End Function
%>
正则表达式去除链接:
复制代码 代码如下:
Function RegRemoveHref(HTMLstr)
Set ra = New RegExp
ra.IgnoreCase = True
ra.Global = True
ra.Pattern = "<A[^>]+>(.+?)<\/A>"
RegRemoveHref = ra.replace(HTMLstr,"$1")
END Function
加载全部内容