asp下消除超链接的函数
asp下消除超链接的函数: 代码如下: <% 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 (编辑:银川站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |