VS Code Search and Regex/Collapse repeated blank lines

Reduce multiple blank lines to one.

Section: Regex Examples

Collapse repeated blank lines

regex
regex
Find: \n{3,}
Replace: \n\n

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Regex Examples
Find trailing whitespace
Match spaces at end of lines.
OpenIn sheetregexsame section
Find TODO / FIXME markers
Locate common work markers in code.
OpenIn sheetregexsame section
Find console.log statements
Locate debugging logs in JS/TS.
OpenIn sheetregexsame section
Match quoted strings
Simple pattern to match single or double quoted strings.
OpenIn sheetregexsame section
Replace repeated spaces with one
Normalize spacing.
OpenIn sheetregex2 tag match
Convert key: value style to quoted keys
Useful when massaging JS-like objects into JSON-like keys.
OpenIn sheetregex2 tag match