【问题标题】:How to find all words that have one (or more) blank space(s) in them in Notepad++?如何在 Notepad++ 中查找所有包含一个(或多个)空格的单词?
【发布时间】:2019-03-05 00:02:08
【问题描述】:

这是一个示例,所有行都被修剪了前导和尾随空格。

单词单词
单词单词单词
词词词词
单词

结果是

单词单词

【问题讨论】:

  • 请提供您的问题的Minimal, Complete, and Verifiable Example。如果您不为我们提供可合作的内容,您的帖子将会遭到lack of effort 和/或lack of code 的反对。
  • 哦,对不起,我忘了在我的问题中写 Notepad++。谢谢你提醒我!
  • 选择word word而不是word word word的标准是什么?请edit your question 并添加更多信息。
  • 对我来说,一个带有空格的单词不是一个单词,而是多个单词。
  • 正如我所问的,我需要找到其中有一个空格的单词。

标签: search text notepad++ space


【解决方案1】:

如果你想找到只有一个空格的行(前后有一些“单词”),试试这个:

^\S+ \S+$

解释:

^        # Begin of line
  \S+    # non-blank character repeated 1 or more times
  [ ]    # a space (I'm using [ ] to make it more clear)
  \S+    # non-blank character repeated 1 or more times
$        # end of line

Demo

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多