精品秘无码一区二区三区老师-精品秘一区二三区免费雷安-精品蜜桃秘一区二区三区-精品蜜桃秘一区二区三区粉嫩-精品蜜桃一区二区三区-精品蜜臀国产aⅴ一区二区三区

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

常用的ASP正則過濾函數(shù) 可過濾html js style div font

admin
2010年7月22日 21:52 本文熱度 4909
開發(fā)程序,經(jīng)常要用到正則表達式進行過濾一些不需要的東西,比如html js style div font,有時候需要過濾極個別的,有時候需要過濾好幾種,不管怎么過濾,萬變不離其宗。[br][br] 這是我收藏的一些過濾函數(shù),可以用來過濾您不需要的代碼。如果需要過濾多種,可以嵌套使用,也可以自己整合代碼。不過不建議嵌套使用,因為那樣效率太低。[br][br][br]asp 正則表達式 過濾 所有 html 標記 :[br][br]
[img]images/code.gif[/img] 程序代碼
function losehtml(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "<\/*[^<>]*>"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]losehtml = clstemplosestr[br]end function[br][br]asp 正則表達式 過濾 style 標記 :[br][br]
[img]images/code.gif[/img] 程序代碼
function losestyletag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "(]*>[^\0]*(<\/style>)+"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]losestyletag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br]asp 正則表達式 過濾 層 div 標記 :[br][br]
[img]images/code.gif[/img] 程序代碼
function losedivtag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "<(\/){0,1}div[^<>]*>"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]losedivtag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br]asp 正則表達式 過濾 鏈接 a 標記 :[br][br]
[img]images/code.gif[/img] 程序代碼
function loseatag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "<(\/){0,1}a[^<>]*>"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]loseatag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br]asp 正則表達式 過濾 字體 font 標記 :[br][br][br]
[img]images/code.gif[/img] 程序代碼
function losefonttag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "<(\/){0,1}font[^<>]*>"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]losefonttag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br][br]asp 正則表達式 過濾 span 標記 :[br][br]程序代碼[br]function losespantag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "<(\/){0,1}span[^<>]*>"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]losespantag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br][br]asp 正則表達式 過濾 object 標記 :[br][br][br]
[img]images/code.gif[/img] 程序代碼
function loseobjecttag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = ""[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]loseobjecttag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br]asp 正則表達式 過濾 iframe 標記:[br][br]
[img]images/code.gif[/img] 程序代碼
function loseiframetag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "(]*>[^\0]*(<\/iframe>){1,}"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]loseiframetag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br]asp 正則表達式 過濾 script :[br][br]
[img]images/code.gif[/img] 程序代碼
function losescripttag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "(]*>[^\0]*(<\/script>){1,}"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]losescripttag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br]asp 正則表達式 過濾 class 標記 :[br][br]
[img]images/code.gif[/img] 程序代碼
function loseclasstag(contentstr)[br]dim clstemplosestr,regex[br]clstemplosestr = cstr(contentstr)[br]set regex = new regexp[br]regex.pattern = "(class=){1,}(""|\'){0,1}\s+(""|\'|>|\s){0,1}"[br]regex.ignorecase = true[br]regex.global = true[br]clstemplosestr = regex.replace(clstemplosestr,"")[br]loseclasstag = clstemplosestr[br]set regex = nothing[br]end function[br][br][br][br]字符串替換 replace 的正則表達式 :[br][br][br]
[img]images/code.gif[/img] 程序代碼
<%function replacereg(str,patrn,replstr,ignor)[br]'=========================================[br]'參數(shù)解釋:[br]'str 原來的字符串[br]'patrn 要替換的字符串(正則表達式)[br]'replstr 要替換成的字符串[br]'ignor 是否區(qū)分大小寫(1不區(qū)分,0區(qū)分)[br]'=========================================[br]dim regex ' 建立變量。[br]if ingor=1 then ingor=true else ingor=false[br]set regex = new regexp ' 建立正則表達式。[br]regex.pattern = patrn ' 設置模式。[br]regex.ignorecase = ignor ' 設置是否區(qū)分大小寫。[br]regex.global=true[br]replacereg = regex.replace(str,replstr) ' 作替換。[br]end function[br][br]'例如 將 weblank.com 替換成 weblank.com[br]response.write(replacereg("weblank.com","www\.weblank\.com","weblank.com",1))[br][br]%>

該文章在 2010/7/22 21:52:07 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點晴ERP是一款針對中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內(nèi)大量中小企業(yè)的青睞。
點晴PMS碼頭管理系統(tǒng)主要針對港口碼頭集裝箱與散貨日常運作、調(diào)度、堆場、車隊、財務費用、相關(guān)報表等業(yè)務管理,結(jié)合碼頭的業(yè)務特點,圍繞調(diào)度、堆場作業(yè)而開發(fā)的。集技術(shù)的先進性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點晴WMS倉儲管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務都免費,不限功能、不限時間、不限用戶的免費OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved

主站蜘蛛池模板: 国产在线精品一区二区不卡麻豆 | 国产成人免费永久在线平台 | 国产又黄又猛又粗又爽的A片动漫 | 中文人妻熟女乱又乱精品 | 亚洲一区二区三区高清 | 亚洲欧美国产精品无码中文字 | 亚洲天天在线日亚洲洲精 | 久久久久国色av免费看 | 自拍偷自拍亚洲精品偷一 | 无码人妻少妇久久中文字幕蜜桃 | 国产伦孑沙发午休精品 | 日韩人妻精品无码久久上司 | 国产天美传媒性色av | 国产日韩一区二区三区在线观看 | 插插好爽爽爽啊 | 国产无码h在线播放 | 自拍在线观看 | 中国免费无码的网 | 巨人精品福利官方导航 | 国产av无码专区影视 | 国产欧美精品aaaaaa片 | 无码人妻精品一区二区三区蜜桃 | 亚洲欧美韩国日产综合在线 | 亚州精品一区中文字幕乱码 | 最新国产精品鲁鲁免费视频 | 欧美 亚洲 中文 国产 综合 | 欧美日韩看片在线观看 | 免费看一区无码无A片WWW | 亚洲一区二区三区四区香蕉 | 亚洲国产日本韩国欧美mv | 亚洲欧美一区二区三区图片 | 国产精品视频第一区二区三区 | 好爽好多水C死你视频 | 亚洲自拍自偷成人网 | 97精品伊人久久久大香线蕉 | 亚洲精品无码你懂的 | 成人国产一区二区 | 国产精品免费久久久久影院 | 欧美乱妇乱码大黄AA片 | 最新午夜理论电影影院在线 | 亚洲成a∧人片在线播放 |