Regex Tester
Test regular expressions live with matches, positions and capture groups.
The Regex Tester lets you build and debug JavaScript regular expressions against real text, live. Type a pattern, toggle flags, and every match appears with its position and capture groups — no console, no setup, instant feedback.
Regular expressions are powerful and notoriously easy to get subtly wrong: a pattern that matches too much, too little, or hangs on certain inputs. Seeing exactly what matched, where, and which groups were captured turns trial-and-error into deliberate construction. The tool reports errors with the same messages your engine would throw, and flags can be toggled individually (g for all matches, i for case-insensitive, m for multiline, s for dot-all, u for unicode).
This tester uses the JavaScript (ECMAScript) regex engine — the same flavor as browsers and Node.js. Regex syntax differs across languages, so patterns written here may need adjustment for PCRE (PHP, Perl) or other engines. Everything runs locally in your browser.
Flags
5 matches
JavaScript (ECMAScript) flavor. Check "g" to find all matches, "i" for case-insensitive, "m" for multiline, "s" for dot-all, "u" for unicode.
How to use the Regex Tester
- Type your pattern (leave the slashes off — flags have their own buttons).
- Toggle the flags you need — 'g' to list every match.
- Type or paste the text to search.
- Read each match with its start index and capture groups.
- Fix pattern errors using the message shown under the pattern field.
Frequently asked questions
Which regex flavor does this use?
JavaScript (ECMAScript) — the engine inside browsers and Node.js. If your target is PHP, Python, or grep, the core syntax is similar but features differ (lookbehind support, \d semantics, named groups), so test in your target environment too.
Why does my pattern only show one match?
Without the 'g' (global) flag, regex engines stop at the first match. Toggle 'g' to list every match with its index — the flag buttons make the difference visible immediately.
How do I see capture groups?
Wrap parts of your pattern in parentheses — (\d+)-(\.\w+) — and each match lists its groups as $1, $2… beneath it. Non-capturing groups (?:…) let you group without creating captures.
Related tools
View all developer tools →JSON Formatter & Validator
Format, minify and validate JSON instantly with clear error messages that point at the exact problem.
Dev ToolsJSON Validator
Check if your JSON is valid and find syntax errors with exact line and column.
Dev ToolsJSON Minifier
Compress JSON to its smallest valid form for storage and transport.
Dev ToolsJSON to CSV
Convert a JSON array of objects into a clean CSV file in one click.
Dev ToolsCSV to JSON
Convert CSV (from Excel or Google Sheets) into a JSON array of objects.
Dev ToolsBase64 Encoder
Encode text or files to Base64 — standard or URL-safe — in your browser.