問題:
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