Home › Toolkit › Developer › Regex Tester

🎯 Regex Tester

Regular expressions are written once and debugged forever. Test yours here against real text: see every match, its position and its capture groups, before the pattern ever touches production.

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

  1. Type the pattern (without the surrounding slashes).
  2. Set flags — g to find all matches.
  3. 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

Making videos too? Try our YouTube SEO Checker, or browse the full Toolkit and the free YouTube tools.