Search and replace in Visual Studio

后端 未结 6 830
遥遥无期
遥遥无期 2020-12-29 03:52

In Visual Studio, when I search within a selection, I want to replace the first instance (or second, third, etc.) of a match per line using regular expressions. How would I

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 03:58

    I can be done without a regular expression as well:

    Replace = foo with = bar.

    If a regular expression is needed, one could use:

    foo(\d*) = foo(\d*);
    

    Replace with:

    foo\1 = bar\2;
    

提交回复
热议问题