The Ultimate Regex Cheat Sheet for 2026
Regular expressions are one of the most powerful tools in a developer's toolkit. Here are the patterns you will actually use.
Email Validation
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Matches standard email formats. Not RFC 5322 compliant (nothing is), but catches 99% of real emails.
URL Matching
https?://[^\s/$.?#].[^\s]*
Matches HTTP and HTTPS URLs in text. Simple but effective for most extraction tasks.
IPv4 Address
\b(?:\d{1,3}\.){3}\d{1,3}\b
Matches IP addresses. Does not validate ranges (255 max) — add that logic in code.
Date Formats
\d{4}-\d{2}-\d{2} matches ISO dates (2026-01-15).
\d{2}/\d{2}/\d{4} matches US dates (01/15/2026).
Password Strength
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Requires: lowercase, uppercase, digit, special character, 8+ length.
JSON Key Extraction
"([^"]+)"\s*: extracts all keys from a JSON string.
Log Timestamp
\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2} matches ISO 8601 timestamps in log files.
Test all of these in our Regex Tester — paste the pattern, add your test string, and see matches highlighted in real-time.
Related Posts
Sponsor Our Newsletter
Reach thousands of developers who are actively evaluating AI tools, MCP servers, and dev infrastructure. Our weekly newsletter goes to engaged technical decision-makers.
All sponsored content is clearly labeled per our editorial policy.