在Sublime Text中使用正则表达式替换文本

4
如何在Sublime Text中替换部分旧文本?
我有以下文本:
<span class="foo">some text</span>
<span class="foo">another text</span>

I want:

<b>some text</b>
<b>another text</b>

搜索

<span class="foo">(\w+)</span> 

替换为

{1} 

无法工作

2个回答

3

搜索: <span class="foo">(.*?)</span>

替换为: <b>$1</b>


谢谢。我在替换参数方面犯了错误。 - NCNecros

1
使用$1替代{1}来替换文本。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接