Interactive Regex Cheatsheet - Online Quick Reference
An interactive reference for regular expression tokens. Click a token to see its explanation and example. Learn regex faster.
UD5 Toolkit
| Match # | Full Match | Group 1 | Group 2 | Group 3 | ... |
|---|
^ | Start of string/line |
$ | End of string/line |
\b | Word boundary |
\B | Non-word boundary |
\d | Digit [0-9] |
\D | Non-digit |
\w | Word character [A-Za-z0-9_] |
\W | Non-word character |
\s | Whitespace (space, tab, newline) |
\S | Non-whitespace |
. | Any character except newline |
* | 0 or more times |
+ | 1 or more times |
? | 0 or 1 time |
{n} | Exactly n times |
{n,} | At least n times |
{n,m} | Between n and m times |
*? +? ?? | Lazy versions |
(x) | Capturing group |
(?:x) | Non-capturing group |
x(?=y) | Positive lookahead |
x(?!y) | Negative lookahead |
(?<=y)x | Positive lookbehind (ES2018) |
(? | Negative lookbehind (ES2018) |
(?<name>x) | Named capturing group (ES2018) |
g | Global search |
i | Case-insensitive |
m | Multi-line mode (^ and $ match line boundaries) |
u | Unicode mode |
s | Dotall mode ('.' matches newline) |
y | Sticky mode (matches from lastIndex) |
regex.test(str) | Returns true/false |
regex.exec(str) | Returns match details |
str.match(regex) | Returns matches (or first match without g) |
str.matchAll(regex) | Iterator of all matches (needs g flag) |
str.replace(regex, newSubstr|fn) | Replace matches |
str.search(regex) | Returns index of first match |
str.split(regex) | Split string by regex |
Click a pattern to use it in the tester.
match() is a string method; without the g flag it returns the first full match and groups, with g it returns an array of all full matches (no groups). exec() is a regex method that returns one match at a time with groups and updates lastIndex (useful for looping). Use matchAll for all matches with groups.
The dot . matches any character except newline by default. To include newlines, enable the s (dotAll) flag: /pattern/s.
Use the i flag: /pattern/i.
A group (...) captures the matched substring for later use (e.g., in replacements or via exec). Non-capturing groups (?:...) group without capturing.
Use string.matchAll(regex) with the g flag. It returns an iterator of match arrays including groups. Alternatively, loop with exec() while regex.lastIndex is valid.
Use a function to escape: str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').
An interactive reference for regular expression tokens. Click a token to see its explanation and example. Learn regex faster.
Search and copy HTML entities for arrows, math, currency, and symbols. See the glyph and code. Fast reference.
Drop a PDF and extract any embedded JavaScript or form actions. Check for malicious code. Privacy‑friendly analysis.
Enter a CSS selector and see its specificity broken down into A,B,C columns with a visual weight comparison. Learn specificity.
Generate the doGet() and doPost() boilerplate for a Google Apps Script web app. Ready to paste into the editor.
Choose Babel presets (env, React, TypeScript) and plugins. Get a clean babel.config.json to transpile your code. Local tool.
Recreate the target CSS linear gradient by adjusting stops and colors. A unique game for front‑end developers to master gradients.
Quick reference of HTTP methods with their semantics, idempotency, and example REST usage. Static, fast.
Fill in a component name and generate a complete Stencil.js component with TSX, CSS, and test files. Quick start.
Enter a resource name and HTTP method to get a complete Express route handler with try/catch and comments.
Enter a common chemical name to see summary hazard pictograms and precautions. Quick reference.
Select text and see the Selection object properties. Create ranges programmatically. Understand how rich‑text editors work.
Search for common ingredient substitutions (e.g., buttermilk, egg, cornstarch). Quick reference for when you're missing something. Local data.
Create and format Markdown tables by adjusting rows and columns. Align text, copy the raw Markdown. Perfect for README files.
Chain multiple CSS filter functions and see the result on an image. Copy the filter string. No upload.
Create a looping animated gradient background with multiple color stops. Copy the complete CSS keyframes. Eye‑catching.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Render 1000 styled elements using inline styles vs. CSS classes and compare time. Understand CSS‑in‑JS trade‑offs.
Create beautiful, syntax-highlighted screenshots of your code snippets. Choose themes and export as PNG. All client-side canvas rendering.
Click to get a random HTTP status code with its name and description. See 418 I'm a teapot. Fun for devs.
Drag and drop pieces to set up a chess position. Generate FEN string and copy to share. Analyze openings. Local only.
See how `animation‑composition: replace, add, accumulate` works by layering animations on the same property. Understand the spec.
Select a Node.js version from the LTS list and instantly download a .nvmrc file. Lock your project’s runtime.
Generate strong random strings for API tokens, session secrets, or encryption keys. Uses crypto.getRandomValues().
Answer questions about project type and strength needed to get a joint recommendation. Animations.
Apply real-time CSS filters or canvas effects to a video and download the processed output. Experiment with video post-processing locally.
Move your mouse to create colorful ink swirls in a simulated fluid. Beautiful and mesmerizing. No install. Just WebGL.
Generate an SVG placeholder image with custom text, width, height, and colors. Use as a placeholder service. Pure SVG.
Generate truly random numbers within a specified range. Useful for contests, game decisions, and sampling. Runs locally, no hidden algorithms.
Generate a random Sudoku puzzle with a unique solution. Choose difficulty and type numbers on the board. Timer and mistake counter.