需要帮助编写正则表达式来替换匹配项中的文本和字符
我有大量 HTML 文件,必须对所有出现的 href="" 进行全局搜索,并对引号内的内容执行以下操作:
%28 = 删除
%29 = 删除
%2C = 删除
%26 = 和
%20 = -
_ = -
.htm = .html
小写全部大写
如果有人在编写正则表达式方面更有知识,我们将不胜感激。我将在 Textmate 中输入搜索和替换表达式。
I have large number of HTML files where I have to do a global search on all occurrences of href="" and perform the following on the contents inside the quotes:
%28 = remove
%29 = remove
%2C = remove
%26 = and
%20 = -
_ = -
.htm = .html
lowercase all caps
Any help from someone more knowledgeable in writing regular expressions would be greatly appreciated. I will be entering both the search and replace expressions in Textmate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 textmate 的了解不够,无法帮助将小写字母转换为全部大写字母。
您还可能会找到textmate 手动正则表达式部分
I don't know enough about textmate to help with converting lowercase to all caps.
You also might find the textmate manual regex section