最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

asp 正則實現(xiàn)清除html文本格式的函數(shù)代碼

 更新時間:2010年03月14日 15:48:38   投稿:mdxy-dxy  
正則匹配(正則表達式)模式進行數(shù)據(jù)匹配替換

復(fù)制代碼 代碼如下:

<%
'/* 函數(shù)名稱:Zxj_ReplaceHtml ClearHtml
'/* 函數(shù)語言:VBScript Language
'/* 作  用:清除文件HTML格式函數(shù)
'/* 傳遞參數(shù):Content (注:需要進行清除的內(nèi)容)
'/* 函數(shù)作者:張曉/軍(古城童話) QQ:382511147
'/* 函數(shù)說明:正則匹配(正則表達式)模式進行數(shù)據(jù)匹配替換

Function ClearHtml(Content)
Content=Zxj_ReplaceHtml("&#[^>]*;", "", Content)
Content=Zxj_ReplaceHtml("</?marquee[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?object[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?param[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?embed[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?table[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("&nbsp;","",Content)
Content=Zxj_ReplaceHtml("</?tr[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?th[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?p[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?a[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?img[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?tbody[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?li[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?span[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?div[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?th[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?td[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?script[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("(javascript|jscript|vbscript|vbs):", "", Content)
Content=Zxj_ReplaceHtml("on(mouse|exit|error|click|key)", "", Content)
Content=Zxj_ReplaceHtml("<\\?xml[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("<\/?[a-z]+:[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?font[^>]*>", "", Content)
Content=Zxj_ReplaceHtml("</?b[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?u[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?i[^>]*>","",Content)
Content=Zxj_ReplaceHtml("</?strong[^>]*>","",Content)
ClearHtml=Content
End Function

Function Zxj_ReplaceHtml(patrn, strng,content)
IF IsNull(content) Then
content=""
End IF
Set regEx = New RegExp ' 建立正則表達式。
regEx.Pattern = patrn ' 設(shè)置模式。
regEx.IgnoreCase = true ' 設(shè)置忽略字符大小寫。
regEx.Global = True ' 設(shè)置全局可用性。
Zxj_ReplaceHtml=regEx.Replace(content,strng) ' 執(zhí)行正則匹配
End Function
%>

相關(guān)文章

最新評論

星座| 陈巴尔虎旗| 盖州市| 新沂市| 洛浦县| 佛教| 邹城市| 丰宁| 沛县| 依安县| 无棣县| 隆昌县| 洛川县| 罗城| 朝阳市| 闻喜县| 兰西县| 鄂托克前旗| 醴陵市| 湖口县| 柘荣县| 宝山区| 黄冈市| 西华县| 樟树市| 阿城市| 鄂伦春自治旗| 永康市| 内丘县| 元阳县| 剑阁县| 蒙城县| 沁源县| 洛川县| 木兰县| 洞口县| 新民市| 岳阳县| 大方县| 浙江省| 平利县|