http://blog.csdn.net/babyt/archive/2004/09/08/98516.aspx
最近有人来问我如何将文章用文本格式保存,而不是直接使用html存储,这样的话会节约数据库空间.于是写了这么个函数来将文本中的html标记剔除
函数虽然简单,但是对处理html文档还是很有效的
<%
function removehtml(strhtml)
dim objregexp, match, matches
set objregexp = new regexp
objregexp.ignorecase = true
objregexp.global = true
取闭合的<>
objregexp.pattern = "<.+?>"
进行匹配
set matches = objregexp.execute(strhtml)
遍历匹配集合,并替换掉匹配的项目
for each match in matches
strhtml=replace(strhtml,match.value,"")
next
removehtml=strhtml
set objregexp = nothing
end function
%>
文章整理:站长天空 网址:http://www.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




