Regex Tester

Test a regular expression against sample text and see the matches highlighted live.

Seeing your pattern actually work

Regular expressions are powerful and famously easy to get subtly wrong, and the only reliable way to build one is to test it against real examples. This runs your pattern against sample text and highlights what it matches as you type, so you can refine the expression until it catches exactly what you intend and nothing more.

Enter your pattern and some test text, and the matches light up.

Build it up, don't guess it

The way to write a working regex is incrementally: start with the simplest pattern that matches part of your target, check it against varied examples including the ones that should not match, then tighten it step by step. Testing against edge cases is where the real bugs surface — the input with an unexpected character, the empty string, the almost-match. Seeing capture groups and matches live turns regex from trial-and-error guesswork into something you can actually reason about.

Regex Tester FAQ

Why test a regex instead of just writing it?

Regex is easy to get subtly wrong. Testing against real examples, including ones that should not match, is the only reliable way to get it right.

Does it show capture groups?

Yes — matches and their groups are highlighted so you can see exactly what the pattern captures.

Is my text uploaded?

No. The matching happens in your browser.

More Developer tools