Regex Examples and Cookbook/Collapse blank lines

Match repeated blank lines.

Section: Cleanup and Normalization

Collapse blank lines

regex
regex
(?:\r?\n\s*){3,}
Explanation

Replace with `\n\n` or similar to reduce whitespace.

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 Cleanup and Normalization
Match leading or trailing spaces per line
Trim each line in multiline mode.
OpenIn sheetregexsame section
Match Windows line endings
Find CRLF line endings.
OpenIn sheetregexsame section
Strip simple HTML-like tags
Match simple HTML tags for rough removal.
OpenIn sheetregexsame section
Normalize phone separators
Match common phone separators.
OpenIn sheetregexsame section
Redact card-like numbers
Find common 16-digit card-like sequences with separators.
OpenIn sheetregexsame section
UUID shape
Match a standard hyphenated UUID.