Search code examples
searchtextnotepad++space

How to find all words that have one (or more) blank space(s) in them in Notepad++?


This is a sample, all lines have been trimmed leading and trailing spaces.

word word
word word word
word word word word
word

Result would be

word word


Solution

  • If you want to find lines that just have one space (with some 'word' before and after), try with this:

    ^\S+ \S+$

    Explained:

    ^        # 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