Search and replace in Visual Studio

后端 未结 6 816
遥遥无期
遥遥无期 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 04:12

    As simple as this in Visual Studio 2019 Find/Replace. I needed to replace FORTRAN IO format string to C++ format and used sub-expression and numbers of regexp.

    Example: find: "f9.8", "f18.3", in line and replace with %9.8f, %18.3f
    reg exp: Find = ( f)(\d+.\d+) Replace = %$2f

提交回复
热议问题