Emacs:如何删除文本行尾的所有连字符?

Emacs:如何删除文本行尾的所有连字符?

我扫描了一份 PDF,其中行尾有常见的连字符,需要处理文本。

例子:

There are these two young fish swim-
ming along and they happen to meet 
an older fish swimming the other 
way, who nods at them and says "Mor-
ning, boys". 

我想通过一些正则表达式魔法得到的东西是显而易见的:

There are these two young fish swimming along and they happen to meet an older fish swimming the other way, who nods at them and says "Morning, boys".

我尝试过\([a-z]\)-$^\([a-z]\),但没有任何结果。

答案1

我找到了一个解决方案。诀窍是在搜索正则表达式中插入第二行。这可以通过在搜索端输入 Cq Cj 来完成。所以我输入的是:

\([a-z]\)- C-q C-j \([a-z]\)

Cq Cj 之前没有任何 SPC,这导致迷你缓冲区看起来像这样:

\([a-z]\)-
\([a-z]\)

相关内容