Notepad++ 如何删除没有句号的行中的回车 return

Notepad++ How to delete carriage return in lines without full stops only

我有文档在句子中间包含回车 returns,如下所示:

Were there any connections? Or
was all of it

我找到了一个用于查找这些行的正则表达式(查找:\w$),如果需要,我可以插入一个句号(替换:[=14=].)但是我该怎么做才能插入一个space 并移除马车 return/delete 它变成这样:

Were there any connections? Or was all of it

我有很多这些要替换,所以获得一个可以处理所有这些的替换命令会很有帮助。

有办法吗?

  • Ctrl+H
  • 查找内容:(?<=\w)\R(?=\w)
  • 替换为: A space
  • 检查 环绕
  • 检查 正则表达式
  • 全部替换

解释:

(?<=\w)     # positive lookbehind, make sure we have a word character before
\R          # any kind of linebreak
(?=\w)      # positive lookbahead, make sure we have a word character after

屏幕截图(之前):

截图(之后):