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.
Enter a regex pattern (without slashes)
click to toggle flags
Match Preview
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
^Start of string / line
$End of string / line
\bWord boundary
\BNon-word boundary
*0 or more (greedy)
+1 or more (greedy)
?0 or 1 (optional)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m times
*?0 or more (lazy)
+?1 or more (lazy)
(abc)Capturing group
(?:abc)Non-capturing group
(?<name>abc)Named capturing group
\1Backreference to group 1
\k<name>Named backreference
(a|b)Alternation — match a or b
(?=abc)Positive lookahead — followed by abc
(?!abc)Negative lookahead — not followed by abc
(?<=abc)Positive lookbehind — preceded by abc
(?<!abc)Negative lookbehind — not preceded by abc
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.
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.
Explore more free utilities in Development
Regex Tester
Real-time regular expression tester with highlighting and cheat sheet.
Open
JSON Diff
Compare two JSON objects structurally to find differences.
Open
Subnet Calculator
Calculate IP ranges, netmasks, and CIDR subnet details.
Open
Cron Generator
Visual builder for Cron schedules with next-run previews.
Open
CSS Box Shadow
Visually design and generate CSS box-shadow code.
Open
Gitignore Generator
Create custom .gitignore files for your projects instantly.
Open