I want to transform this
a
b
b
into this
a
b
b
number of empty lines is variable and can be pretty huge. Empty lines contains spaces. I want to use a regexp like \r\n( *\r\n)+, but notepad++ seems not to like those special characters in regexp, tryed also \\r\\n( *\\r\\n)+
Please note that empty lines may contain spaces, so the correct regexp would be something like \\r\\n( *\\r\\n)+
You can do ‘replace all’ multiple times on
That’s with ‘Extended’ option selected, not ‘Regular expression’.
If the empty line contains spaces, then first replace all lines with only spaces with nothing using regex:
^\s+$->''. Then to the extended replacement above.Alternatively:
You can also replace all
\r\nwith some sequence of characters that doesn’t exists in the document, e.g.###then use the following regex replacement :'###(\s*###)+' -> '###'and finally replace back the sequence (‘###’) with\r\n.