D

Regex Tester / Debugger

Live regex testing with match highlighting, captured groups, and flag controls.

Runs 100% in your browser — nothing is uploaded

About this tool

The Regex Tester evaluates your regular expression against test text in real time as you type, highlighting matches and showing captured groups. Supports all JavaScript regex flags: g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), and d (indices).

Regular expressions are one of the most powerful and frequently misread tools in programming. Debugging them in code means a slow edit-run-print cycle. This tool gives you instant feedback: paste your test string, enter your pattern, and see every match highlighted as you refine the expression. Named capture groups are shown in a structured table alongside their indices.

Match details include: total match count, per-match start/end indices, the full match text, and the value of each capture group (including named groups). When the regex is invalid, a specific error message is shown. The pattern and flags persist in the URL so you can share a working regex with a colleague. All evaluation uses the browser's native RegExp engine — no server, no transpilation.

Frequently asked questions

Which regex flavor does this tool use?
JavaScript's built-in RegExp engine (ECMAScript). It supports lookahead, lookbehind (ES2018+), named capture groups (ES2018+), and unicode property escapes (ES2018+ with the u flag). It does not support PCRE-specific features like possessive quantifiers or atomic groups.
How do I match across multiple lines?
Use the m flag to make ^ and $ match the start/end of each line (not just the whole string). Use the s flag (dotAll) to make . match newline characters.
What is a named capture group?
Named groups use the syntax (?<name>pattern) and let you access matched text by name instead of index. For example, /(?<year>\d{4})-(?<month>\d{2})/ captures year and month as named fields. They show in the groups table in this tool.
Can I test my regex against a large file?
Yes — paste the text directly. For very large inputs (several MB), evaluation may take a moment. Be careful with catastrophic backtracking: patterns like (a+)+ on long strings without a match can run for a very long time.