Reference

Regex Cheat Sheet

Live

Search 24 common ECMAScript regex constructs by category and test a JavaScript pattern against sample text.

About Regex Cheat Sheet

Browse a focused JavaScript regular-expression reference covering characters, anchors, quantifiers, groups, assertions, and flags. Search or filter the cards, then experiment in a local pattern playground with highlighted matches.

Set up Regex Cheat Sheet

Workspace

Reference desk

Use the fields below to narrow the local reference material to the details you need.

This workspace updates as you edit.

Search patterns, meanings, categories, examples, or behavior.

Choose the maximum number of matching reference entries to display.

Regex Cheat Sheet: rows

Choose the values that apply, then search reference.

Reference source and matching

Filter 24 bundled ECMAScript reference entries by text; run optional playground patterns locally with the browser RegExp engine.

How it works

The reference is a bundled, curated summary of common ECMAScript RegExp syntax. The playground calls the browser’s RegExp constructor and matchAll, so its behavior follows that browser’s JavaScript engine rather than PCRE, Python, .NET, or another flavor.

Examples

Find digit-related syntax

Example input
{
    "query": "digit",
    "limit": 5
}
Expected result
{
    "rows": [
        {
            "category": "Characters",
            "pattern": "\\d / \\D",
            "meaning": "Digit / non-digit",
            "example": "/\\d+/",
            "behavior": "Matches “2026”"
        }
    ],
    "count": 1
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Citations & sources

  1. ECMAScript Language Specification: RegExp Objects

Frequently asked questions

Which regex flavor does this page describe?

The cards and playground target ECMAScript regular expressions as implemented by modern JavaScript engines. Syntax and behavior can differ in PCRE, Python, Java, .NET, RE2, and other engines.

Why does a copied pattern include doubled backslashes in JSON?

A backslash must itself be escaped inside JSON and many programming-language string literals. A regex literal and a string passed to RegExp can therefore require different source spelling.

Is the playground safe for untrusted patterns?

It runs only in your browser, but some patterns can still cause excessive backtracking and freeze a tab on crafted or long text. Keep experiments small and review patterns before using them on untrusted input.

Does the cheat sheet cover every ECMAScript feature?

No. It is a compact quick reference. Consult the current ECMAScript specification for complete grammar, Unicode sets, engine support, and edge cases.