国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

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

2024-05-04 11:00:13
字體:
供稿:網(wǎng)友
復制代碼 代碼如下:
<%
'/* 函數(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(" ","",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 ' 設置模式。
regEx.IgnoreCase = true ' 設置忽略字符大小寫。
regEx.Global = True ' 設置全局可用性。
Zxj_ReplaceHtml=regEx.Replace(content,strng) ' 執(zhí)行正則匹配
End Function
%>

您可能感興趣的文章:

ASP中過濾UBB和Html標簽ScriptHtml 函數(shù)之過濾html標記的asp代碼asp CutStrX字符串截取函數(shù)(過濾全部HTML標記)ASP.NET過濾HTML字符串方法總結(jié)ASP.NET過濾HTML標簽只保留換行與空格的方法asp中實現(xiàn)清除html的函數(shù)
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 福建省| 临西县| 济源市| 且末县| 吉首市| 天祝| 珠海市| 晋城| 常德市| 淮滨县| 江口县| 南漳县| 贺州市| 新津县| 吉水县| 兴国县| 盐津县| 贵港市| 叙永县| 延安市| 宣汉县| 靖江市| 旬阳县| 水富县| 文山县| 平山县| 鹿泉市| 广州市| 河北区| 和政县| 监利县| 宿州市| 财经| 大足县| 吴旗县| 成武县| 彭水| 邯郸县| 平乐县| 江安县| 广东省|