About this tool
A regex is a tiny program, and like every program it deserves a test before it ships. This tester runs your pattern with the browser's own engine — the same engine your JavaScript will use — and shows you not just whether it matched, but every match with its index and the contents of each capture group. That group view is where the real debugging happens: patterns usually match something; the question is whether they capture the right pieces.
It also stands guard against the classic regex accident: a pattern that can match the empty string with the global flag would loop forever in naive code, so the tester advances safely and caps the match list, telling you it did. Catastrophic backtracking patterns will still make the tab think hard — that, too, is information worth having here rather than on your server.
How to use it
- Type the pattern (without the surrounding slashes).
- Set flags — g to find all matches.
- Paste test text and press Test pattern.
Good to know
- Anchor when it matters: ^ and $ (with the m flag) stop partial matches from pretending to be full ones.
- Debug capture groups one at a time: simplify the pattern until the group you care about is right, then build back up.
- Test the failures, not just the successes — paste text that should NOT match and confirm it does not.
Frequently asked questions
Which regex flavour is this?
JavaScript's — the engine in your browser. Most syntax is shared with other flavours; lookbehind and named groups follow JavaScript's rules.
Why did it stop at 500 matches?
A safety cap against patterns that match everywhere (including empty matches). Narrow the pattern or the text.
Is my test text uploaded?
No — matching runs locally in your browser.
More Developer tools
JSON Formatter & Validator
Pretty-print messy JSON, minify it back, and get a precise error location when it will not parse.
JSON to CSV
Turn a JSON array of objects into a clean spreadsheet-ready CSV, columns and escaping handled.
CSV to JSON
Convert spreadsheet CSV into a JSON array — quoted fields, embedded commas and all.
XML Formatter
Indent and validate XML — sitemaps, feeds, config files — with errors pointed at the guilty tag.
JS / CSS / HTML Beautifier
Untangle minified or messy code into readable, consistently indented JavaScript, CSS or HTML.
JS / CSS Minifier
Strip comments and needless whitespace from JavaScript and CSS — smaller files, same behaviour.
Making videos too? Try our YouTube SEO Checker, or browse the full Toolkit and the free YouTube tools.