正则的一些写法

str1="<a class=""srPatentName"" id='patentID=DDD-2454'></a><a class=""srPatentName"" id='patentID=ASSS-4444'></a><a class=""srPatentName"" id='patentID=KKK-23123'></a><a class=""cClass"" id='c1'></a>"

sub replaceimg(str)
dim  re
set re = new RegExp
re.Pattern = "<a(.*?)id='(.*?)'></a>"

re.Global = true
'response.write re.replace(str,"$1")

Set Matches = re.Execute(str)

for each match in matches
response.write match.SubMatches(1)
next

end sub

 

 

 

 

str1="<P><P><IMG src=""/uploadimages/200908/20090814105325.gif"" border=0><center><IMG src=""/uploadimages/200908/20090814105325.gif"" border=0></center></P>"

function replaceimg(str)
dim  re
set re = new RegExp
re.Pattern = "<IMG([^>]*)border=0>"
re.Global = true
replaceimg=re.replace(str,"[IMG$1]")

end function
t1=replaceimg(str1)
t2=htmlfilter(t1)
'response.write t2

function replaceimgre(str)

dim re
set re = new RegExp
re.Pattern = "/[IMG([^/]]*)/]"
re.Global = true
replaceimgre=re.replace(str,"$1")

end function

t3=replaceimgre(t2)

response.write t3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值