如何在 sublime text 2 中进行正则表达式搜索和替换? [英] How do I do a regex search and replace in sublime text 2?

查看:68
本文介绍了如何在 sublime text 2 中进行正则表达式搜索和替换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 ST2 中的 html 文档中删除内联样式.

I want to remove inline style from an html document in ST2.

我想我的正则表达式会是这样的样式=\"*\"

I imagine my regex will be something like this style=\"*\"

如果那是错的,没关系.我相信我会找出我需要的表达方式.

If that's wrong, it doesn't matter. I'm sure I'll figure out the expression I'll need.

我无法弄清楚的是如何实际使用正则表达式来查找或查找和替换 ST2 中的文本.文档说可以做到.但我找不到有关如何操作的文档.

What I haven't been able to figure out, is how to actually use a regex to find or to find and replace text in ST2. The docs say that it can be done. But I can't find the documentation for how to do it.

推荐答案

我有一个类似的任务要执行,我以 Nas62 建议的方式使用的正则表达式是

I had a similar task to perform, the regex I used in the manner that Nas62 suggested was

style=\"(.*?)\"

这篇关于如何在 sublime text 2 中进行正则表达式搜索和替换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆