VSCode regex find & replace submatch math?

前端 未结 6 1939
栀梦
栀梦 2020-11-30 18:34
%s@{fileID: \\(213[0-9]*\\)@\\=\'{fileID: \'.(submatch(1)-1900)@

I am using this regex search and replace command in vim to subtract a constant fro

6条回答
  •  半阙折子戏
    2020-11-30 18:47

    Given a regular expression of (foobar) you can reference the first group using $1 and so on if you have more groups in the replace input field.

提交回复
热议问题