手机
当前位置:查字典教程网 >编程开发 >ASP教程 >asp下去除超链接的函数
asp下去除超链接的函数
摘要:复制代码代码如下:正则表达式去除链接:复制代码代码如下:FunctionRegRemoveHref(HTMLstr)Setra=NewReg...

复制代码 代码如下:

<%

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

【asp下去除超链接的函数】相关文章:

收集asp的常用函数

asp错误的几种处理方式

asp 常用函数用法

asp中对ip进行过滤限制函数

asp 删除图片与文件函数

asp中的Rnd 函数

多字段模糊搜索的函数

asp中向文本框输出数据原样式的函数

asp之字符串操作函数

asp下载防盗链代码

精品推荐
分类导航