男女做爽爽爽网站-男女做羞羞高清-男女做爰高清无遮挡免费视频-男女做爰猛烈-男女做爰猛烈吃奶啪啪喷水网站-内射白浆一区

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發文檔 其他文檔  
 
網站管理員

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

admin
2010年7月22日 21:52 本文熱度 5464
開發程序,經常要用到正則表達式進行過濾一些不需要的東西,比如html js style div font,有時候需要過濾極個別的,有時候需要過濾好幾種,不管怎么過濾,萬變不離其宗。[br][br] 這是我收藏的一些過濾函數,可以用來過濾您不需要的代碼。如果需要過濾多種,可以嵌套使用,也可以自己整合代碼。不過不建議嵌套使用,因為那樣效率太低。[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]'參數解釋:[br]'str 原來的字符串[br]'patrn 要替換的字符串(正則表達式)[br]'replstr 要替換成的字符串[br]'ignor 是否區分大小寫(1不區分,0區分)[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 ' 設置是否區分大小寫。[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 編輯過
關鍵字查詢
相關文章
正在查詢...
點晴ERP是一款針對中小制造業的專業生產管理軟件系統,系統成熟度和易用性得到了國內大量中小企業的青睞。
點晴PMS碼頭管理系統主要針對港口碼頭集裝箱與散貨日常運作、調度、堆場、車隊、財務費用、相關報表等業務管理,結合碼頭的業務特點,圍繞調度、堆場作業而開發的。集技術的先進性、管理的有效性于一體,是物流碼頭及其他港口類企業的高效ERP管理信息系統。
點晴WMS倉儲管理系統提供了貨物產品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質期管理,貨位管理,庫位管理,生產管理,WMS管理系統,標簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務都免費,不限功能、不限時間、不限用戶的免費OA協同辦公管理系統。
Copyright 2010-2025 ClickSun All Rights Reserved

主站蜘蛛池模板: 国产高清在线露脸一区 | 久久久这里只有免费精品2024 | 香港三级精品三级在线专区 | 久久97精品久久久久久久看片 | 国产福利姬喷水福利在线 | 无码国产精品一区二区免费网曝 | 国产麻豆一区二区三区精品视频 | 伊人久久大香线蕉综合5g | 欧美日韩在线免费 | 久久久国产精品无码一区二 | 久久天天躁狠狠躁夜夜中文字幕 | 自拍一区 综合图区 | av香港三级级在线播放 | 2024欧美国产在线视频网 | 日本高清视频在线无吗 | 里番全彩爆乳女教师精品人妻码一区二区三区 | 亚洲成a人片777777 | 精品亚洲大全 | 国产无遮挡A片又黄又爽 | 日本午夜视频 | 国产成人午夜精品免费视频 | 四虎影视2024最新址 | 精品无码一区二区三区在线 | 国产一区二区三区精品欧美日韩 | 国产精品自在拍一区二区不卡 | 国产免费又黄又爽又色的小说 | av无码久久久久久久久不卡网站 | 欧美特级理论片免费看 | 国产在线观看www | 永久精品大片www. 91网站入口 | 国产微拍一区二区三区四区 | 无码人妻黑人中文 | 狠狠综合久久久久综合 | 四虎最新地址通知www | 国产成人无码av一区二区三区 | 亚洲欧洲日产无码av网站 | 视频国产在线观看 | 中文字幕久久久久久久系列 | 久久av无码精品人妻系列果冻传媒 | 天堂精品视频一区二区在线观看 | 国产伦理一区二区三区在线观看 |