Regex Cheatsheet & Builder
Interactive regex reference with a live tester. Click any token to append it to your pattern. Includes common pattern presets for email, URL, IP, and more.
Live Tester
Enter a regex pattern (without slashes)
click to toggle flags
Match Preview
Regex Reference
Click any token to append it to the pattern.
.Any character except newline
\dDigit [0-9]
\wWord character [a-zA-Z0-9_]
\sWhitespace (space, tab, newline)
\DNon-digit
\WNon-word character
\SNon-whitespace
[abc]Character set — matches a, b, or c
[^abc]Negated set — not a, b, or c
[a-z]Range — any lowercase letter
Regex Cheatsheet & Builder — Regular Expression Reference
Regular expressions (regex) are patterns used to match character combinations in strings. This tool combines a live regex tester with a comprehensive cheatsheet so you can build and test patterns without switching tabs.
Quick Tips
Use raw strings
In code, escape backslashes: \d becomes "\\d" in a string literal.
Prefer non-greedy
Use +? or *? to match as little as possible and avoid over-matching.
Named groups
Use (?<name>...) to name captures for easier extraction in code.
Test edge cases
Always test with empty strings, special characters, and boundaries.