问题:
I'm looking to do search replace with regular expressions in Sublime Text 2. The documentation on this is rather anemic.我希望在 Sublime Text 2 中用正则表达式进行搜索替换。 关于此的文档相当贫乏。 Specifically, I want to do a replace on groups, so something like converting this text:具体来说,我想对组进行替换,因此类似于转换此文本:
Hello my name is bob
And this search term:这个搜索词:
Find what: my name is (\\w)+
查找内容: my name is (\\w)+
Replace with: my name used to be $(1)
替换为: my name used to be $(1)
The search term works just fine but I can't figure out a way to actually do a replace using the regexp group.搜索词工作得很好,但我想不出一种使用正则表达式组实际进行替换的方法。
解决方案:
参考一: https://stackoom.com/question/natK参考二: Regular expression search replace in Sublime Text 2