Regex Tester

Write a regular expression, paste test text and see matches highlighted live — with capture groups, flags and clear error messages.

696 views

Try Your Pattern Before It Ships

Type a JavaScript regular expression, toggle its flags (g, i, m, s, u) and paste sample text: every match is highlighted in place and listed below with its position and capture groups. Errors in the pattern are shown as readable messages instead of silently matching nothing.

The engine is your browser's own JavaScript regex implementation — so what matches here matches in your JS code identically. For other languages (PCRE, Python) the core syntax is largely shared, but lookbehind and some escapes can differ; test edge cases in the target language too. Everything runs locally.

Frequently Asked Questions

Which regex flavour does this use?

JavaScript (ECMAScript) — the browser's native engine. Patterns behave exactly as they would in your JS code; PCRE and Python share most syntax but differ in some advanced constructs.

What do the flags mean?

g finds all matches instead of the first; i ignores case; m makes ^ and $ match per line; s lets the dot match newlines; u enables full Unicode handling.

Why does my pattern freeze the page?

Certain patterns with nested quantifiers (like (a+)+b) can backtrack catastrophically on long inputs. Shorten the test text or restructure the pattern — the same freeze would hit your production code.

Similar Tools