Reference
Quick reference for regular expression tokens and patterns.
Runs entirely in your browser
Nothing you paste is uploaded. Monaco and Prettier load on demand from this origin.
Search
| Token | Name | Meaning |
|---|---|---|
| \d | Digit | Any digit 0-9. |
| \w | Word char | [A-Za-z0-9_]. |
| \s | Whitespace | Space, tab, newline. |
| . | Any char | Any character except newline. |
| ^ | Start | Start of string/line. |
| $ | End | End of string/line. |
| * | Zero+ | Zero or more of the previous. |
| + | One+ | One or more of the previous. |
| ? | Optional | Zero or one; lazy quantifier. |
| {n,m} | Range | Between n and m repetitions. |
| [abc] | Class | Any of a, b, or c. |
| (?:...) | Non-capture | Group without capturing. |
| (?=...) | Lookahead | Positive lookahead. |
| \b | Boundary | Word boundary. |
There is no upload endpoint — your files are processed in this browser tab. Open your network tab and check. See how it stays private.
How to regex cheatsheet
- Find a construct. Search for the token or concept you need.
- Read the example. See what it matches with a short example.
- Build your pattern. Assemble the regex you need.
Regex syntax is easy to forget between uses, and a compact cheatsheet with examples gets you unstuck fast — recalling how lookaheads, backreferences, or non-capturing groups work.
To test a pattern live against sample text, use the Regex playground; to extract matches from a real file, the Data Zone regex extractor.
Frequently asked questions
What does \b mean in regex?
A word boundary — a zero-width position between a word character and a non-word character — used to match whole words. The cheatsheet covers it and the other anchors.
What's the difference between greedy and lazy quantifiers?
Greedy (*, +) match as much as possible; lazy (*?, +?) match as little as possible. The cheatsheet shows both with examples.
Is anything fetched?
No. The reference is built in and works offline.