I spent some time trying to figure out how to delete all blank lines in Visual Studio Code and I can\'t get it working. Anybody knows how to do it please?
If I search fo
At My case. kobi7 solution (\r?\n){2,}
only worked for me,
I had to run it again with small modification to make it work for single lines (just changed 2 to 1)
^(\r?\n){1,}
There is my version for cleaning empty lines with white space:
find: (?:\s*$(\r?\n)){2,}
replace: $1
Here's my regex, it catches all extra new lines and empty lines that contain only space,tabs etc
\n\s*\n
And I replace all matches with \n
Explanation
\n : New Line
\s* : Zero or more consecutive white space characters or new lines
\n : Another New Line
P.S :Remember to choose the regex option in the search window!!