Regex Examples and Cookbook/Redact card-like numbers

Find common 16-digit card-like sequences with separators.

Section: Cleanup and Normalization

Redact card-like numbers

regex
regex
\b(?:\d{4}[- ]?){3}\d{4}\b
Explanation

Use carefully and sanitize logs responsibly.

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 Windows line endings
Find CRLF line endings.
OpenIn sheetregexsame section
Collapse blank lines
Match repeated blank lines.
OpenIn sheetregexsame section
Match leading or trailing spaces per line
Trim each line in multiline mode.
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
UUID shape
Match a standard hyphenated UUID.