28,391
社区成员
发帖
与我相关
我的任务
分享
<%@ Language=VBScript %>
<%
dim re
Set re=new RegExp
re.IgnoreCase =true
dim strcontent,p
'p=request.QueryString("id")
p=10
strcontent="<1>abc<1><3>xyz<3><10>sss<10>"
re.Pattern=".*?<("&p&")>(.*?)<\1>.*?"
response.write re.replace(strcontent,"$1 $2<br>")
%>
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="<([^>]+)>(.*?)<\1>"
strcontent="<1>abc<1><3>xyz<3><10>sss<10>"
response.write re.replace(strcontent,"$1 $2<br>")
<%
dim s,i
s="<1>abc<1><3>xyz<3><10>sss<10>"
with new regexp
.pattern="<(\d+)>(.*?)<\1>"
.ignorecase=true
.global=true
response.write "<pre>"
for each i in .execute(s)
response.write i.submatches(0) & chr(9) & i.submatches(1) & vbcrlf
next
response.write "</pre>"
end with
%>