Regex Tester
Test JavaScript regular expressions interactively. Highlight matches, view capture groups, copy results, common regex cheat sheet sidebar. Works offline.
About this tool
A JavaScript regex playground for the browser. Type a pattern, toggle the six standard flags (g, i, m, s, u, y), and paste your test string. Matches are highlighted in place; the match list shows the matched text and its start index; the capture group panel shows both numbered ($1, $2โฆ) and named (?<name>โฆ) groups for the first match. A clickable cheat sheet in the sidebar covers characters, quantifiers, anchors, character classes, and groups โ tap any token to append it to your pattern. Errors in the pattern are reported inline. Copy all matches to the clipboard with one tap. Auto-saves your last pattern, flags, and test string. Works fully offline.
Details
- Category
- Utilities
- Version
- 1.0.0
- Size
- 27 KB
- Updated
- Jun 2026
Frequently Asked Questions
Which regex flavor does this use?
JavaScript ECMAScript regex โ the same engine Chrome, Node, Deno, and Bun use. Patterns from Python, PCRE, or .NET may not behave identically (lookbehinds and named groups have different rules).
What does each flag do?
g โ find all matches, not just the first. i โ case-insensitive. m โ ^ and $ match line breaks. s โ dot (.) matches newlines. u โ Unicode-aware mode. y โ sticky, matches only at lastIndex.
Why is the highlight empty even though my regex looks right?
The g flag must be ON for multiple matches. Without it, only the first match is highlighted. The match list and capture groups also reflect the g-flag behavior.
How are capture groups shown?
The capture groups panel shows the first match's groups. Numbered groups appear as $1, $2, $3; named groups appear as their name. Undefined or non-matching groups show as โ .
Is my pattern sent anywhere?
No. Patterns, flags, and test strings never leave your browser. Everything runs locally via the JavaScript RegExp constructor. Auto-save stores the last input in localStorage for your convenience.