VSCode regex find & replace submatch math?

前端 未结 6 1942
栀梦
栀梦 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 19:02

    Just to add another example:

    I was replacing src attr in img html tags, but i needed to replace only the src and keep any text between the img declaration and src attribute.

    I used the find+replace tool (ctrl+h) as in the image:

提交回复
热议问题