Sublime Text 2 中的正則表達式搜索替換 - Regular expression search replace in Sublime Text 2

問題:

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章