Test a regular expression against a subject, with every match, its position, and its numbered and named capture groups.
Regex Cheatsheet Generator
A reference table of JavaScript regular expression syntax, grouped by purpose, with an example for every token.
- Free
- No sign-up
- Runs in your browser
Input
The full table is shown; use your browser’s find to search it.
Ready
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
The full reference is shown below, grouped into character classes, quantifiers, anchors, groups, lookaround and flags.
- 2
Every entry includes a worked example.
Questions about Regex Cheatsheet Generator
Is \w the same as "a letter"?
No, and this is the most common surprise. `\w` is exactly `[A-Za-z0-9_]` - ASCII only. It does not match `é`, `ü` or any non-Latin letter. For real Unicode letters use `\p{L}` with the `u` flag.
Is this syntax the same in every language?
Close, but not identical. This table documents the JavaScript engine. Python, PCRE, Go RE2 and .NET all differ in places - Go's RE2 has no backreferences or lookaround at all, by design, so that matching is always linear time.
Is my data sent anywhere?
No. This tool runs as JavaScript inside your browser tab. There is no network request carrying your input, nothing is written to a server log, and it keeps working with your connection switched off. You can confirm it in the browser’s network panel. That matters more here than elsewhere on the site: developer tools handle tokens, keys and production data.
Does the Regex Cheatsheet Generator work offline?
Yes. Once the page has loaded it runs entirely as JavaScript on your own device, so the Regex Cheatsheet Generator keeps working with the network switched off and nothing is ever sent to a server.
Is anything I enter into the Regex Cheatsheet Generator uploaded or stored?
No. The Regex Cheatsheet Generator runs in your browser, so whatever you type or paste never leaves your device — there is no server round-trip, nothing is logged, and there is nothing to delete afterwards.
Related tools
Other tools you might reach for next.
Preview a regular expression replacement, with every match listed so you can check it before running it for real.
Format and indent JSON, with optional alphabetical key sorting and a precise syntax error when it will not parse.
Strip every byte of insignificant whitespace from JSON and report the saving.
Check that JSON is syntactically valid, report its structure, and flag duplicate keys that JSON.parse accepts silently.
Compare two JSON documents structurally, by path, distinguishing a type change from a value change.
Evaluate a JSONPath expression against a document and see every match with the path that produced it.
Escape text so it can be embedded as a JSON string value, handling control characters and astral code points.