^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Covers UUID versions 1–5 and the standard variant bits.
Large cookbook of validation, extraction, cleanup, and code-search regex recipes for everyday engineering work.
Practical validators and shape checks.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Covers UUID versions 1–5 and the standard variant bits.
^(?:25[0-5]|2[0-4]\d|1?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|1?\d?\d)){3}$Avoids invalid octets like 999.
^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,}$Good for a simple domain shape check.
^#(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$Covers 3, 6, and 8 digit forms.
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$Useful for package and release tooling.
^\d{4}-\d{2}-\d{2}$Shape validation only; calendar validity is a separate concern.
Patterns that extract high-value substrings from larger text.
https?://[^\s<>"']+A pragmatic extractor for logs, markdown, and prose.
\b[^\s@]+@[^\s@]+\.[^\s@]+\bUseful for scanning text dumps and documents.
\[([^\]]+)\]\(([^)]+)\)Capture group 1 is the label and group 2 is the URL.
[^,]+Useful only for simple CSV; quoted CSV needs a more robust parser.
```(\w+)?
[\s\S]*?
```Common when cleaning or indexing markdown content.
\b(INFO|WARN|WARNING|ERROR|DEBUG|TRACE|FATAL)\bHelpful for log triage and indexing.
Regexes that clean or normalize messy text.
\r
Useful when normalizing files to LF.
(?:\r?
\s*){3,}Replace with `\n\n` or similar to reduce whitespace.
^\s+|\s+$Use multiline mode to trim line edges.
</?[^>]+>Okay for lightweight cleanup, not for full HTML parsing.
[-.\s()]Useful when converting formatted phone numbers into digits-only values.
\b(?:\d{4}[- ]?){3}\d{4}\bUse carefully and sanitize logs responsibly.
Regex patterns used with source code and structured text.
"([^"\\]+)"\s*:Helpful for quick scans, though a parser is safer for full JSON.
^[A-Za-z0-9_.-]+:Useful for lightweight audits of YAML-like files.
(?i)\bselect\s+\*\s+from\bUseful for database code cleanup.
\bid=["\']([^"\']+)["\']Useful for audits and DOM refactors.
\.[A-Za-z_-][A-Za-z0-9_-]*Useful for scanning stylesheets or extracting class tokens.
^[A-Za-z_][A-Za-z0-9_]*=.*$Useful for scanning or validating env files.