求助!这样的网址正则替换怎样写?
想用正则表达式把默认页网址中的syjh/info_linktype.asp?info_id=6244305替换成html/6244/info_show_6244305.html这样的形式,该怎样写?请注意在要替换的形式中,数字的规律是,取出从右数第四位开始到最左一位的数字,放到info_show前html/后。再举个例子,例如:syjh/info_linktype.asp?info_id=123456342要替换成html/123456/info_show_123456342.html 用php接口,光靠正则貌似不可能实现的. syjh/info_linktype\.asp\?info_id=(\d{4})(\d{3})
替换成
html/$1/info_show_$1$2.html 谢谢管理员rq204。
火车头功能强大无比,向中小站长强烈推荐! 那大站长咋办! syjh/info_linktype\.asp\?info_id=(\d{4})(\d{3})
替换成
html/$1/info_show_$1$2.html
rq204 发表于 2009-6-17 09:25 http://bbs.locoy.com/images/common/back.gif
这个写的不够完美啊!!试试这个
syjh/info_linktype\.asp\?info_id=(\d+)(\d{3})
替换成
html/$1/info_show_$1$2.html 热心的车友还真不少!
回cshack :大站好像较少用采集吧。ali82ls
回langford :ali84ls
页:
[1]