The quick answer

A one-scroll reference to the JavaScript regex vocabulary: character classes, quantifiers, groups, lookarounds and flags, each with a worked example. ^\d{3}-\d{4}$ matches 555-1234 and rejects 55-1234 — the sheet explains every token that way. It documents ECMAScript specifically and runs in your browser.

The problem the Regex Cheat Sheet solves

A task brought you here, not curiosity: the syntax you half-remember, the construct you cannot quite name. The Regex Cheat Sheet puts the whole JavaScript regex vocabulary one scroll away — every class, quantifier, group and assertion, each with a worked example you can copy.

The sheet documents the JavaScript (ECMAScript) flavor specifically — the engine your browser and Node.js actually run. Character classes, quantifiers, groups, lookarounds and flags each get an entry with a copyable example, and the divergence points from PCRE are marked where they matter: no possessive quantifiers in ECMAScript, and backreferences to failed groups behave differently.

Bimodal is the honest description of developer tooling: heavyweight IDEs at one end, one-shot browser utilities at the other. Reformatting a 40-line SQL query or testing one regex in an IDE is overhead without payoff; the same jobs in a browser tab are pure text transformations — formatters, regex testers, cron builders, CSS generators, HTML scaffolding — that need no project context and run instantly client-side. Regex Cheat Sheet is one of those tabs.

The Regex Cheat Sheet workflow, start to finish

The sheet is deliberately minimal — a reference grid plus a live tester — but there is a right order of operations that gets you to the right construct fastest. Follow these six steps.

  1. Scan the quick-reference grid

    The grid condenses the JavaScript regex vocabulary into one-liners: \d \w \s for classes, a* a+ a? a{2,5} for quantifiers, (a) (?:a) (?<name>a) for groups, (?=a) (?!a) for lookaheads, $1 for backreferences. Each token gets one line of plain English.

  2. Find the construct you half-remember

    Every entry is token-plus-description, so the difference between (a) and (?:a), or between ^ and \b, is one glance instead of a search detour. The negated set [^abc] and the alternation a|b sit in the same grid.

  3. Type it into the pattern field

    The tester beside the grid takes the construct live: pattern between the slashes, flags in the small field (gi by default), preloaded test string in the box. The grid and the tester share the page on purpose.

  4. Prove it on the test string

    Replace the sample text with your own; matches highlight in context and the match table lists each hit with its position and capture groups — up to 50 rows.

  5. Watch for the error line

    An unsupported construct — a possessive quantifier, a stray bracket — draws a warning with the engine's own message. The sheet documents ECMAScript, and the tester enforces it.

  6. Close the tab when you are done

    Everything ran locally: the pattern you tested and the snippets you pasted were never sent anywhere, and closing the tab erases the lot.

How the sheet is organized — and a worked pattern

Entries are grouped the way you reach for them: literals and classes (\d, \w, [a-z-]), quantifiers (* + ? {3,8}), groups and backreferences ((…) and \1), assertions ((?=…), (?!…), (?<=…), (?<!…)), and flags (g, i, m, s, u, y). Each entry shows the construct, one line of plain English, and a matched example. Worked end to end: ^\d{3}-\d{4}$ matches 555-1234 — anchored, exactly 3 digits, a hyphen, 4 digits — and rejects 55-1234 and x555-1234, which is the fastest way to feel what ^ and $ actually buy you.

The recipes people actually look up

The recipes people actually search for: an email-shaped pattern, a date extractor, a password-strength check, a word-boundary extraction. Each recipe shows the pattern, an input it succeeds on and an input it rejects — because half of regex confidence is knowing what fails, not just what matches. Paste any of them straight into the tester to watch both verdicts live.

  • Email-shaped — ^[\w.%+-]+@[\w.-]+\.[a-z]{2,}$ matches jane_smith+test@company.org and rejects jane@company (no domain ending).
  • ISO date — \b\d{4}-\d{2}-\d{2}\b matches 2026-11-15 and rejects 2026-11-5, where the single-digit day fails the {2} demand.
  • Password shape — ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$ accepts Passw0rd! and rejects password: three lookaheads act as independent requirements, a construct ECMAScript supports natively.
  • Word-boundary extraction — \b\w+\b pulls whole words out of any line; widen the class to [\w.%-]+ and you are most of the way to the tester's preloaded email pattern.

Who keeps a regex cheat sheet open

In the right context, the Regex Cheat Sheet graduates from "found once" to "open weekly". Here are the five professions that use it most — and exactly how.

Backend developers — the extraction pattern you need once a quarter (pulling quoted strings out of a log line) is on the sheet with a worked example, so the quarterly ritual stops being a 20-minute search detour.

Frontend developers — a form-validation pattern proven against real user inputs before release, with the construct's one-line entry on the sheet close at hand; the highlight-on-keystroke loop converges on the right expression faster than console trial-and-error.

DevOps engineers — the sheet documents ECMAScript specifically, so before writing a grep -E line you can see which constructs (lookarounds, \d shorthand) will not survive POSIX ERE unchanged — exactly where one-off greps go wrong.

Technical writers — document a validation rule precisely: copy the construct's one-line explanation and example straight from the sheet into the spec, and the reader gets the same definition the code implements.

Students — learning regex the direct way: type a pattern, watch the matches highlight the instant it changes, skip the console trial-and-error entirely. Regex Cheat Sheet gives the same immediate feedback for its job.

None of those people asked for a dashboard. They asked for a reference. Regex Cheat Sheet's tool-first design is the institutionalised version of that lesson.

What the cheat sheet covers, at a glance

The table summarizes what the regex cheat sheet promises and how it behaves — the same commitments every tool on this site keeps.

AspectThis tool
Processing100% client-side (JavaScript in your browser)
Signup requiredNo — no account, no email, no cookies for consent-free use
Data uploadedNever — inputs stay on your device by architecture
SpeedInstant, live recomputation on every keystroke
Mobile supportFull — touch-optimized, responsive layout
Offline useWorks after first load (except live-data tools, which say so)
CostFree, funded by clearly-labelled advertising away from controls
DocumentationFull methodology, worked examples and FAQ on this page

What this tool does not tell you

  • Catastrophic backtracking is not on the grid — nested quantifiers like (a+)+ can take exponential time, and the tester will happily let you type one; test on a smaller string first and prefer an unrolled rewrite such as (a[^a]*a).
  • Lookbehind support is browser-dependent — (?<=…) and (?<!…) work in every current browser but threw in older Safari; the tester's error line tells you immediately if yours is behind.
  • The grid documents one flavor — ECMAScript. Possessive quantifiers, \K and recursion belong to PCRE and stay off the sheet, because they would throw in your JavaScript.

Your snippets never leave the browser

Patterns describe your systems — hostnames, card formats, password rules — and test snippets often carry real data. The cheat sheet and its examples run as plain JavaScript on your device: nothing you type or test becomes a network request, and closing the tab erases it.

How the Regex Cheat Sheet compares

This tool is replaceable, and pretending otherwise helps nobody. This comparison shows what the Regex Cheat Sheet trades and what it refuses to trade away.

AlternativeWhere it winsWhere this tool wins
regex101Explanations attached to a live tester — the place to debug one pattern in depthA one-scroll grid of every token (\d \w \s, groups, lookarounds, flags) with one-line descriptions, built for recall rather than debugging
MDN's regular expressions guideThe exhaustive prose reference, when you want the full story of a constructThe condensed version: token, one line, example — find the construct in seconds, then test it live right beside the grid
RegExrA community pattern library to browse for ready-made expressionsNo community detour and no login: the reference grid plus a live pattern, flags and test-string loop on the same page

Trade-offs, not verdicts: deep software buys capability with setup and licensing; Regex Cheat Sheet buys a ninety-second answer with zero obligation.

When a construct confuses you, check these first

A few habits separate Regex Cheat Sheet the one-off from Regex Cheat Sheet the daily default; the accumulated playbook for this tool is below.

  • Start from the preloaded example on an unfamiliar tool: a known pattern with a known match set validates your understanding in ten seconds before you trust it with real data.
  • Chain tools when a workflow needs more than one step — the related-tools links below are ordered by what people typically combine, and the output carries straight into the next tool.

When something behaves unexpectedly, the causes are almost always one of these:

  • Zero matches on a string you know matches — check the flags: without i, Test and test are different strings, and ^ and $ anchor the whole string until m switches them to line mode.
  • A character class matches one character — [abc] is one of a, b or c, not the sequence abc; the tester's match table makes the length of each hit visible at a glance.

Frequently asked questions

Is the Regex Cheat Sheet free to use?

Yes, completely free. There is no signup, no email gate and no count of how many times you run it. Regex Cheat Sheet runs entirely in your browser, so each extra use costs this site nothing and costs you nothing either. Check as many patterns as the job requires.

Which regex flavor does the cheat sheet document?

JavaScript's ECMAScript flavor — the engine browsers and Node.js run natively. The sheet marks the spots where it diverges from PCRE: no possessive quantifiers, lookbehinds supported in current browsers, and backreferences to failed groups behaving differently. If you write JavaScript, this is the dialect your code actually speaks.

How do I read a pattern like ^\d{3}-\d{4}$?

Left to right: ^ anchors the string start; \d{3} demands exactly three digits; the hyphen matches itself; \d{4} demands four digits; $ anchors the end. It matches 555-1234 and rejects 55-1234 (too few leading digits) and 555-12345 (one digit too many). The sheet explains every token the same way.

Can I use the Regex Cheat Sheet offline?

Mostly yes: once the page is cached, Regex Cheat Sheet runs without a connection, since the computation happens on your device. The exceptions — anything requiring live rates or lookups — are marked on the page and simply wait until you are back online.

Can anyone see the snippets I run through Regex Cheat Sheet?

No. The sheet and its tester run as plain JavaScript on your device — patterns and test snippets never leave the tab, and the network panel stays silent while you work. Nothing is stored, because there is nothing to store it with.

How can I test my regex against more than one string?

Paste the whole batch into the test area. Matches across all lines are highlighted simultaneously, and each one shows its capture groups. The regex cheat sheet workflow is built around that full-picture feedback.

Does the Regex Cheat Sheet work on mobile?

Yes, and mobile was the design baseline: Regex Cheat Sheet was laid out for a phone screen first, so every control is reachable with a thumb and every result updates on keystroke.

Do you store what I enter into the Regex Cheat Sheet?

No uploads, no logging, no retention: the regex cheat sheet math happens in your browser's memory with plain JavaScript. When the tab closes, your data closes with it.

What is the difference between (?:…) and (…)?

The capturing group (…) remembers what it matched, so $1 or \1 can reuse it; the non-capturing group (?:…) groups without remembering, which is cheaper and keeps your group numbering clean. Use (?:…) when you only need grouping — alternation scope or a quantified block — and (…) when you need the contents back.

Regex tools you will actually use alongside

These tools share the Regex Cheat Sheet's workflow most often — the internal links exist because people genuinely chain them, not for keyword decoration.

  • Regex Tester & Debugger — the full testing bench: match table, positions and groups, for when the pattern needs more than a glance to trust.
  • Regex Replace Online — the same engine with a replacement field added: apply the pattern you just looked up and copy the output.
  • JSON to CSV Converter — for extraction jobs that end in tabular data: pull the tokens with a regex, convert the result here.

Sources and further reading

The tool works — and the page you just read is why you can believe it. Between those two facts you have everything needed to use the Regex Cheat Sheet with confidence — and nothing needed to sign up, upload, or pay.

The rest of the Code Formatting, Regex & Design Tools collection keeps this same contract with you: documented methods, local processing, no signup walls. Roam freely.

Sources and further reading

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.