如何在Emacs中使用多行替换搜索?

5
如何在emacs中替换多行匹配项。
例如:将“Dog”替换为 吠叫的 动物
如下所示
The Dog 

随着

The Barking
animal

我尝试在命令replace-regexp中使用\n,但是emacs报错说替换文本中的\无效。

1个回答

16
这篇文章所述,如果您使用M-xreplace-string,则使用C-qC-j输入换行符即可。
因此对于您来说: M-xreplace-string RET Dog RET Barking C-qC-j animal RET

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接