gpt4 book ai didi

visual-studio - Visual Studio 2012 : How to handle code replacement over multiple lines

转载 作者:行者123 更新时间:2023-12-02 23:54:04 25 4
gpt4 key购买 nike

我经常需要替换多个文档中的多行。在 Visual Studio 2012 中,似乎可以将多行代码仅放入一个简单的单行输入框中。

search/replace box layer in Visual Studio 2012 (german language pack)

在“嵌入”搜索框中也只有一个单行输入字段: embedded search/replace box in Visual Studio 2012 (german language pack)

插入通常很长的搜索词并尝试将换行符的正则表达式放入其中后,我必须在单行输入字段内水平移动,这根本不舒服。

是否有其他方法可以在 Visual Studio 2012 中使用查找/替换功能来替换多行?

最佳答案

为了首先替换多行,您必须检查搜索窗口上的正则表达式选项。在下面的示例中,它搜索

   first
second
third

并将其替换为

  fourth
fifth
sixth

搜索文本:第一个([\s\n])第二个([\s\n])第三

替换文本:第四$1第五$2第六

find replace example

关于visual-studio - Visual Studio 2012 : How to handle code replacement over multiple lines,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15337125/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com