undelo

Regex Tester

Test a regular expression against text with live match highlighting

Tests a regular expression against sample text, highlighting every match live as you type the pattern, flags, or test string.

How it works

Your pattern and flags are compiled with the browser's native RegExp engine; matches are then collected by force-adding the 'g' flag internally (even if you didn't type it) so every occurrence gets highlighted, not just the first. Matched portions of the test string are wrapped in a highlight; everything else is shown as plain text.

Frequently asked questions

Do I need to add the 'g' (global) flag myself to see all matches highlighted?

No — highlighting always finds every match regardless of whether you typed 'g'. The flag field still affects other behavior like case-insensitivity ('i') or multiline mode ('m'), and shows in the pattern the same way it would in real code.

Why did it show an error instead of any matches?

Either the pattern itself is invalid regex syntax, or a flag you typed isn't a valid one — the browser's RegExp engine rejects both, and the error message is shown as-is so you can see exactly what it objected to.

Is there a limit on how many matches it shows?

Yes — up to 5,000 matches per test, which is far more than any realistic testing need but keeps an accidental pattern-that-matches-everything from freezing the page on a huge test string.

Does this behave like regex in other languages, like Python or PHP?

It uses JavaScript's native regex engine specifically, which is very similar to most other languages but has some syntax differences (like lookbehind support varying by engine version) — if you're writing regex for another language, treat this as a close approximation, not a perfect match.

Is my test string sent anywhere?

No — pattern matching runs entirely in your browser using JavaScript's built-in regex engine. Nothing is uploaded.