Developer Tools

Regex Cheat Sheet

Regex Cheat Sheet — a quick reference for regular expression syntax.

  • Runs in your browser
  • Free, no signup
PatternMeaningExample
.Any characterc.t
\dDigit\d{3}
\wWord character\w+
\sWhitespace\s+
^Start^hello
$Endworld$
+One or more\d+
*Zero or more\w*
?Zero or onecolou?r
{n}Exactly n\d{4}
{n,m}Between n and m\d{2,4}
[abc]Character class[A-Z]
(a|b)Alternationcat|dog
(?: ... )Non-capturing group(?:ab)+
(?= ... )Lookahead\d(?=px)
(?<= ... )Lookbehind(?<=\$)\d+
\bWord boundary\bword\b
\nNewline\n
(?<name>...)Named group(?<year>\d{4})

Use the tester for live matching, the explainer for token-by-token breakdowns and the generator for common pattern construction.

Your files are processed locally in your browser and are not uploaded to our server.

The cheat sheet gives you a quick, scan-friendly reference for the most common regex tokens and patterns.

Use it to check syntax fast before building or debugging a pattern in the tester.

How to use this tool

  1. Browse the token table by category.
  2. Use the example patterns for quick recall.
  3. Open the tester when you want to validate a pattern on real text.

Frequently asked questions

Is it a complete language reference?

It is a practical quick-reference sheet for common patterns and JavaScript regex features, not an exhaustive treatment of every edge case.

Does it include flags?

Yes. The cheat sheet summarises the key regexp flags and their typical use cases.