日韩欧美人妻无码精品白浆,夜夜嗨AV免费入口,国产欧美官网在线看,高校回应聋哑女生因长相完美被质疑

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

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

admin
2010年7月22日 21:52 本文熱度 5487
開發(fā)程序,經(jīng)常要用到正則表達(dá)式進(jìn)行過濾一些不需要的東西,比如html js style div font,有時(shí)候需要過濾極個(gè)別的,有時(shí)候需要過濾好幾種,不管怎么過濾,萬變不離其宗。[br][br] 這是我收藏的一些過濾函數(shù),可以用來過濾您不需要的代碼。如果需要過濾多種,可以嵌套使用,也可以自己整合代碼。不過不建議嵌套使用,因?yàn)槟菢有侍?。[br][br][br]asp 正則表達(dá)式 過濾 所有 html 標(biāo)記 :[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 正則表達(dá)式 過濾 style 標(biāo)記 :[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 正則表達(dá)式 過濾 層 div 標(biāo)記 :[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 正則表達(dá)式 過濾 鏈接 a 標(biāo)記 :[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 正則表達(dá)式 過濾 字體 font 標(biāo)記 :[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 正則表達(dá)式 過濾 span 標(biāo)記 :[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 正則表達(dá)式 過濾 object 標(biāo)記 :[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 正則表達(dá)式 過濾 iframe 標(biāo)記:[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 正則表達(dá)式 過濾 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 正則表達(dá)式 過濾 class 標(biāo)記 :[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 的正則表達(dá)式 :[br][br][br]
[img]images/code.gif[/img] 程序代碼
<%function replacereg(str,patrn,replstr,ignor)[br]'=========================================[br]'參數(shù)解釋:[br]'str 原來的字符串[br]'patrn 要替換的字符串(正則表達(dá)式)[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 ' 建立正則表達(dá)式。[br]regex.pattern = patrn ' 設(shè)置模式。[br]regex.ignorecase = ignor ' 設(shè)置是否區(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)文章
正在查詢...
點(diǎn)晴ERP是一款針對(duì)中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內(nèi)大量中小企業(yè)的青睞。
點(diǎn)晴PMS碼頭管理系統(tǒng)主要針對(duì)港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場(chǎng)、車隊(duì)、財(cái)務(wù)費(fèi)用、相關(guān)報(bào)表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點(diǎn),圍繞調(diào)度、堆場(chǎng)作業(yè)而開發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點(diǎn)晴WMS倉儲(chǔ)管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲(chǔ)管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號(hào)管理軟件。
點(diǎn)晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時(shí)間、不限用戶的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved