Multi-line regular expressions in Visual Studio

后端 未结 7 883
庸人自扰
庸人自扰 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条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 10:33

    For everyone coming here while searching for VS Code, I use this to match anything from script to anywhere with 2 newlines (newlines excluded):

    script(.|\n)+?(?=\n\n)
    

    replace script and \n\n to match everything between them.

提交回复
热议问题