VSCode regex find & replace submatch math?

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

    In my case $1 was not working, but $0 works fine for my purpose.

    In this case I was trying to replace strings with the correct format to translate them in Laravel, I hope this could be useful to someone else because it took me a while to sort it out!

    Search: (?<=
    ).*?(?=
    ) Replace: {{ __('$0') }}

    Regex Replace String for Laravel Translation

提交回复
热议问题