当前位置: 首页 > 图文教程 > 网络编程 > ASP > 自动去除字符中含有html代码的几个ASP函数

ASP
用密码保护页面 (II)
用密码保护页面 (III)
简单的文件目录浏览源程序
ASP中的函数应用方法及应用举例(一)
ASP中的函数应用方法及应用举例(二)
完整的访问统计系统(一:数据库篇)
完整的访问统计程序(二 程序篇)
完整的访问统计程序(三 应用篇)
一个提供用户输入时期的绝好程序之(一)
一个提供用户输入时期的绝好程序之(二)
构建你的网站新闻自动发布系统之五
构建你的网站新闻自动发布系统之六
完整的访问统计程序(二 程序篇)
完整的访问统计程序(三 应用篇)
ASP环境下邮件列表功能的实现 (一)
ASP环境下邮件列表功能的实现 (二)
ASP环境下邮件列表功能的实现 (三)
ASP环境下邮件列表功能的实现 (四)
ASP进阶之文章在线管理更新(1)
ASP进阶之文章在线管理更新(2)

自动去除字符中含有html代码的几个ASP函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 62 ::
收藏到网摘: n/a

以下为引用的内容:
Function stripHTML(strHTML)
'Strips the HTML tags from strHTML
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")
'Replace all < and > with < and >
strOutput = Replace(strOutput, "<", "<")
strOutput = Replace(strOutput, ">", ">")
stripHTML = strOutput 'Return the value of strOutput
Set objRegExp = Nothing
End Function

以下为引用的内容:
Public Function Replacehtml(Textstr)
Dim Str,re
Str=Textstr
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="<(.[^>]*)>"
Str=re.Replace(Str, "")
Set Re=Nothing
Replacehtml=Str
End Function

以下为引用的内容:
function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(\<.[^\<]*\>)"
str=re.replace(str," ")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str," ")
nohtml=str
set re=nothing
end function

以下为引用的内容:
Function stripHTML(strHTML)
'Strips the HTML tags from strHTML
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")
'Replace all < and > with < and >
strOutput = Replace(strOutput, "<", "<")
strOutput = Replace(strOutput, ">", ">")
stripHTML = strOutput 'Return the value of strOutput
Set objRegExp = Nothing
End Function