The Paper Room

Regex Tester

Regular expressions are powerful but notoriously hard to get right without a feedback loop. This tool lets you type a regex pattern, toggle flags (global, case-insensitive, multiline, dotAll, unicode), and paste a test string — then instantly see every match highlighted in the text and every capture group listed per match.

Matches are highlighted inline so you can visually confirm the pattern is grabbing exactly what you intend, including edge cases like overlapping boundaries and greedy vs lazy quantifiers. Capture groups are displayed in a structured list so you can verify that parenthesized sub-patterns extract the right pieces.

The regex is compiled with the native JavaScript RegExp constructor, so what you see here is exactly what your JavaScript, TypeScript, or Node.js code will produce. Invalid patterns show a clear error message. Everything runs in your browser — no server involved.

By The Paper Room Editorial TeamDeveloper Tools

Frequently asked questions

Which regex flavor does this use?

JavaScript's built-in RegExp engine, which is what runs in every modern browser and in Node.js. If you're writing regex for Python, Java, or another language, most basic patterns are the same, but advanced features (lookbehinds, named groups, Unicode properties) can differ — test in the target language for those.

What do the flags (g, i, m, s, u) do?

'g' (global) finds all matches instead of stopping at the first. 'i' makes the match case-insensitive. 'm' (multiline) makes ^ and $ match the start/end of each line, not just the whole string. 's' (dotAll) makes the dot (.) match newline characters too. 'u' (unicode) enables full Unicode matching and makes quantifiers work correctly on surrogate pairs.

Why am I only seeing one match?

You probably don't have the 'g' (global) flag enabled. Without it, JavaScript's RegExp stops after the first match. Enable the 'g' checkbox to find all matches in the test string.