Multi-line regular expressions in Visual Studio

后端 未结 7 1040
庸人自扰
庸人自扰 2021-01-30 09:58

Is there any way to get Visual Studio to perform a regex replace across multiple lines (let the match cross line boundaries)? I know there are many editors I can use for this, b

7条回答
  •  自闭症患者
    2021-01-30 10:48

    Regular expressions have changed in Visual Studio 2013. https://msdn.microsoft.com/en-us/library/2k3te2cs(v=vs.120).aspx

    To match an expression over two lines the code would now be:

    StartOfExpression.*\r?\n.*EndOfExpression

提交回复
热议问题