What is the match group syntax in Eclipse's search and replace

后端 未结 2 1742
伪装坚强ぢ
伪装坚强ぢ 2021-02-13 08:41

What\'s the syntax to perform a search/replace on Eclipse and use \"match groups\" (is that what it\'s called?)

On vi I do the following:

%s/log\\(.*\\)/         


        
相关标签:
2条回答
  • 2021-02-13 09:38

    Use $1 instead of \1

    For the /g global replace flag, use the Replace All button:


    (source: bpsite.net)

    Note: The above is the Find/Replace dialog for a single file, comes up for Ctrl-F

    For working across multiple files, default shortcut is Ctrl-H, and the dialogs are a bit different:

    eclipse search & replace dialogs

    0 讨论(0)
  • 2021-02-13 09:47

    In the Find Field: log(.*)

    Int the Replace With Field: log$1 debug

    0 讨论(0)
提交回复
热议问题