惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 砖头

正则表达式查询 正则表达式类 Gridview BottomPagerRow添加自定义控件 httpModule过滤无后缀名的文件夹路径请求,iis6和iis7的设置 - 砖头 HttpModules 管道过滤 自定义页面 转:使用IIS 7.0 / 7.5 时配置HttpModules需要注意 HttpModules在IIS下不起作用 Url中文参数传递乱码,表单提交中文乱码,2种解决方法 SQL2008 数据导入导出后,表架构所有者修改解决办法 CSS样式IE8兼容IE7 - 砖头 - 博客园 CSS样式防止图片撑开固定样式 - 砖头 - 博客园 document.body.appendChild 的问题 页面不刷新,表单提交到弹出窗口或Iframe - 砖头 - 博客园 JavaScript表单提交到弹出窗口(转帖) - 砖头 - 博客园 asp.net后台获取前台html控件的值的方法(转帖) 转载:兼容各类浏览器的CSS Hack技巧 您对无法重新创建的表进行了更改或者启用了 阻止保存要求创建表的更改 配置SQL用户访问指定表,指定列 sql server 代理权限问题 编译工程文件后运行,出现找不到“XXX.dll”组件
正则表达式的查找替换字符并批量修改文件名,非代码.
砖头 · 2012-08-03 · via 博客园 - 砖头

通过离线浏览器拿下来网站页面变成静态页面,由于命名规则变成如下:

product.asp@k=&p=2

product.asp@k=&p=3

product.asp@k=&p=4

而页面中的链接还是

product.asp?k=&p=2

product.asp?k=&p=3

product.asp?k=&p=4

还想不破坏网站的连接重新恢复整站,想到把静态页面重命名,全部增加后缀".htm",

并修改页面中的连接,将product.asp?k=&p=4修改为product.asp@k=&p=4.htm 

思路:

1\使用vs2008的查找替换功能,准确的找到product.asp?k=&p=4这种规则的连接,在将这替换成product.asp@k=&p=4.htm 

打开vs2008,将要替换的页面文件包含进vs工程,按ctrl+h,查找的输入面板钩选使用正则表达式,

查找输入框输入匹配的表达式: {\.asp\?.#\"|\'|\ }

替换输入框输入:\0.htm

替换后,路径的规则都很简单了,再处理一下普通替换步骤就ok

2\批量对类似 product.asp@k=&p=4 改名 product.asp@k=&p=4.htm

因为文件名中都带有"."号,使用命令 ren * *.htm 来修改会有问题,经过测试可以使用这个修改后的命令准确的修改文件名:

使用cmd命令进入dos命令符界面,进入文件夹再执行如下命令,如:

d:\test>ren *.asp* *.asp*.htm 就可批量修改完成.

或打开记事本 --> 输入 ren *.asp* *.asp*.htm --> 再保存为 .bat 文件到目标文件夹 --> 再双击执行,完成!