Test regular expressions with live match highlighting and groups.
Test a JavaScript regular expression against sample text and see matches highlighted live, with positions and capture groups in a table. It helps developers build and debug patterns safely, since a runaway pattern is stopped after two seconds.
A regular expression is a compact pattern language for matching text. This tool uses the JavaScript RegExp engine, so syntax such as lookahead, lazy quantifiers, named groups written as (?<name>...), and the flags g, i, m, s, u and y behave as they do in your browser. Capture groups in parentheses return parts of each match, numbered from 1. Patterns with nested repetition, like (a+)+$, can backtrack exponentially on near misses, which is called catastrophic backtracking. The tool runs matching in a background worker and stops it after 2 seconds, and it caps the result at 2000 matches. Always test patterns on non-matching input as well.
JavaScript's built-in RegExp, as in the browser you are using. PCRE, Python or .NET features such as possessive quantifiers may not work.
Some patterns take exponential time. Running in a worker with a timeout keeps the page responsive, and a stopped pattern is reported with a message.
Yes. At most 2000 matches are collected and the count then shows with a plus sign. The table displays the first 200 rows.
No. Enter only the pattern body and use the flag checkboxes. In code you would write /pattern/flags.
No. Matching happens locally in a worker thread of the page.