gpt4 book ai didi

visual-studio-code - Visual Studio代码:\n in regex file search not supported?

转载 作者:行者123 更新时间:2023-12-04 13:21:55 25 4
gpt4 key购买 nike

我正在尝试使用“\n”进行简单的正则表达式搜索,以查找换行符和周围的一些字符串。在单个文件搜索中,它可以正常工作(请参见右侧的屏幕截图),但是在文件夹搜索中,我会收到错误消息“Literal'\n'not allowed”(请参见左侧的屏幕截图)。任何的想法?

Screenshot

干杯丹尼尔

最佳答案

我相信此错误来自ripgrep,VSCode默认将其用于此搜索功能。我发现所有者找到了this comment,尤其是引用了\n

幸运的是,您可以告诉VSCode不要在settings.json中使用ripgrep:

"search.useRipgrep": false

在禁用ripgrep的情况下, \n应该可以正常工作。

关于visual-studio-code - Visual Studio代码:\n in regex file search not supported?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49942726/

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