asp下替換非數(shù)字為空的正則
更新時間:2007年12月28日 16:19:55 作者:
最近用到將字符串替換為空的函數(shù),上網(wǎng)搜了一下這個簡單的東西,網(wǎng)上沒有,于是自己寫個asp下替換字符串為空的正則,太簡單了,見笑了
function replacestr(str)
dim re
set re=new regexp
re.ignorecase=true
re.global=true
re.pattern="\D"
str=re.replace(str,"")
replacestr=str
set re=nothing
end function
dim re
set re=new regexp
re.ignorecase=true
re.global=true
re.pattern="\D"
str=re.replace(str,"")
replacestr=str
set re=nothing
end function
相關文章
用正則表達式批量為a增加target=''''_blank''''新窗口打開的方法
今天在制作模板的時候,發(fā)現(xiàn)一些頁面不是新窗口打開,有時候一些內(nèi)容新窗口打開好些,本來打算手工替換的,發(fā)現(xiàn)了太多,還是正則比較方便一些2013-12-12