‹ Back ✦ AI Chat
/re/

Regex Cheat Sheet

Regular expression syntax at a glance, searchable.

SyntaxMeaning
.Any character except newline
\d / \DDigit / non-digit
\w / \WWord character (letter, digit, _) / non-word
\s / \SWhitespace / non-whitespace
\bWord boundary
^ / $Start / end of string (or line with m flag)
[abc]One of a, b or c
[^abc]Any character except a, b, c
[a-z]Character range a to z
*0 or more
+1 or more
?0 or 1 (optional)
{3} / {2,5} / {2,}Exactly 3 / 2 to 5 / 2 or more
*? / +?Lazy (as few as possible)
(abc)Capturing group
(?:abc)Non-capturing group
(?<name>abc)Named group
a|ba or b
\1Back-reference to group 1
(?=abc) / (?!abc)Lookahead / negative lookahead
(?<=abc) / (?<!abc)Lookbehind / negative lookbehind
\. \* \\Escaped special characters
\n \t \rNewline, tab, carriage return
\p{L}Any Unicode letter (u flag)
g i m s u yFlags: global, ignore case, multiline, dotAll, unicode, sticky
^[\w.+-]+@[\w-]+\.[\w.]+$Example: email address
^\d{4}-\d{2}-\d{2}$Example: ISO date (2026-01-31)
^#?([0-9a-f]{3}){1,2}$Example: hex color

Runs entirely in your browser. Nothing is sent anywhere.

How it works

  1. 1Enter your values.
  2. 2See the result update instantly as you type.
  3. 3Change any value to compare scenarios.

About this tool

Regex Cheat Sheet: Regular expression syntax at a glance, searchable. Type your numbers and the result is calculated instantly — no button to press, nothing to install. All math runs locally in your browser, so the values you enter are never sent anywhere.

Example

SyntaxMeaning
.Any character except newline
\d / \DDigit / non-digit
\w / \WWord character (letter, digit, _) / non-word
\s / \SWhitespace / non-whitespace
\bWord boundary
^ / $Start / end of string (or line with m flag)
[abc]One of a, b or c
[^abc]Any character except a, b, c
[a-z]Character range a to z
*0 or more
+1 or more
?0 or 1 (optional)
How do I use the Regex Cheat Sheet?

Enter your values. See the result update instantly as you type. Change any value to compare scenarios.

Is the Regex Cheat Sheet free?

Yes. It is completely free with no sign-up, no usage limits and no watermark.

Is my data sent to a server?

No. Everything is calculated locally in your browser. Nothing you enter is uploaded, logged or stored.

Does it work on my phone?

Yes. It works in any modern browser on Android, iPhone, iPad, Windows, Mac and Linux — no app needed.