ASP中过滤UBB和Html标签
2018-09-06 13:09
阅读:576
            
  我们存储在数据库中的内容是HTML格式的,但是有时候我们需要无格式的显示这内容,这是用正则表达式实现的过滤。
复制代码 代码如下:
<% 
functionnohtml(str) 
dimre 
Setre=newRegExp 
re.IgnoreCase=true 
re.Global=True 
re.Pattern=(\<.[^\<]*\>) 
str=re.replace(str,) 
re.Pattern=(\<\/[^\<]*\>) 
str=re.replace(str,) 
nohtml=str 
setre=nothing 
endfunction 
%>
评论
亲,登录后才可以留言!