Replacing quote marks around strings in Vim?

前端 未结 8 1669
遇见更好的自我
遇见更好的自我 2021-01-30 11:09

I have something akin to and need to change the single quotation marks to double quotation marks. I tried :s/\\\'.*\\\'/\

8条回答
  •  误落风尘
    2021-01-30 11:52

    You need to put round brackets around the part of the expression you wish to capture.

    s/\'\(.*\)\'/"\1"/
    

    But, you might have problems with unintentional matching. Might you be able to simply replace any single quotes with double quotes in your file?

提交回复
热议问题