How do I replace any number of spaces using regular expressions
Notepad++ Solution
To match one or more space characters:
- Set "Find what" to
+
(space followed by +)
To match one of more whitespace characters (space, EOL, and tab all count as whitespace):
Set "Find what" to
\s+
Warning: Using
\s+
will match end of line and therefore join multiple lines together (separated by the "replace with" string)
To replace with a tab character:
- Set "Replace with" to
\t
To enable regular expression (so the above special codes will work)
- Select "Regular expression".
Source How to use regular expressions in Notepad++ (tutorial)