asp使用正则抓取数据的一个演示代码

[ 2011-12-23 10:52:13 | 作者: admin ]
字号: | |
p.s. 正则使用起来还是方便的,不过忘记了写法就去w3school温习下
<%
'演示1
dim str,reg
str="http://www.abc.com/abc_1_2/"
Set reg=new regexp
reg.global=True '设置为全文搜索
reg.ignorecase=True ‘忽略大小写
reg.pattern="http:\/\/www\.abc\.com\/abc_(\d+)_(\d+)\/"
str=reg.Replace(str,"http://www.abc.com/abc.asp?id=$1&Nid=$2")
response.write str
Set reg=nothing
%>
评论Feed 评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=1761

这篇日志没有评论。

此日志不可发表评论。