Regex Cheatsheet

Quick regex syntax cheatsheet for developers.

Anchors

PatternMeaning
^Start of string
$End of string
\bWord boundary

Quantifiers

PatternMeaning
*0 or more
+1 or more
?0 or 1
{n}Exactly n
{n,}n or more
{n,m}Between n and m

Character classes

PatternMeaning
.Any char (except newline)
\dDigit [0-9]
\DNon-digit
\wWord [a-zA-Z0-9_]
\sWhitespace
[abc]Any of a,b,c
[^abc]Not a,b,c
[a-z]Range a to z

Groups

PatternMeaning
(x)Capturing group
(?:x)Non-capturing
(?<name>x)Named group
|Alternation (or)

Escapes

PatternMeaning
\nNewline
\tTab
\\Backslash
\.Literal .

Flags

PatternMeaning
gGlobal
iCase insensitive
mMultiline
sDotall

What is Regex Cheatsheet?

Reference for common regex syntax: anchors, quantifiers, character classes, groups, and flags.

FAQ

Is this tool free to use?

Yes. This tool is available to use for free.

Does the tool run in the browser?

Yes. The logic runs client-side in your browser.

Is my data uploaded to a server?

No. Your input stays in your browser and is not uploaded by this tool.

Can I use this tool for large files?

It depends on your device and browser. Very large inputs may be slow; for huge files, use a local CLI tool.

How to use

  1. Use the table as a quick reference while writing regex

Related Tools

HTTP Status Code Lookup

Lookup HTTP status codes and meanings.

Open Tool

Password Strength Checker

Estimate password strength and provide feedback.

Open Tool

Port Number Lookup

Lookup common TCP/UDP port numbers.

Open Tool

JSON Formatter

Format, validate, and beautify JSON with syntax highlighting.

Open Tool

JSON Validator

Validate JSON syntax and get clear error messages.

Open Tool

JSON to CSV

Convert JSON array to CSV format.

Open Tool

Popular Tools

JSON Formatter

Format, validate, and beautify JSON with syntax highlighting.

Open Tool

Regex Tester

Test regular expressions and highlight matches.

Open Tool

Base64 Encoder

Encode text to Base64.

Open Tool

UUID Generator

Generate UUID v4 identifiers.

Open Tool

JWT Decoder

Decode and inspect JWT header and payload.

Open Tool