問題:
%s@{fileID: \(213[0-9]*\)@\='{fileID: '.(submatch(1)-1900)@
I am using this regex search and replace command in vim to subtract a constant from each matching id.我在 vim 中使用這個正則表達式搜索和替換命令來從每個匹配的 id 中減去一個常量。
I can do the regex find in VSCode but how can I reference the submatch
for maths & replace?我可以做VSCode正則表達式找到,但我怎麼可以參考submatch
的數學和替換? submatch(1)
does not work in VSCode? submatch(1)
在 VSCode 中不起作用?
Thanks.謝謝。
解決方案:
參考一: https://en.stackoom.com/question/2LFp1參考二: https://stackoom.com/question/2LFp1