VSCode regex find & replace submatch math?

前端 未结 6 1934
栀梦
栀梦 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:52

    To augment Benjamin's answer with an example:

    Find        Carrots(With)Dip(Are)Yummy
    Replace     Bananas$1Mustard$2Gross
    Result      BananasWithMustardAreGross
    

    Anything in the parentheses can be a regular expression.

提交回复
热议问题