Regex Tester
Live pattern matching with highlights
A pattern box, a flags box and a text area, with the results recomputed on every keystroke. The pattern goes straight to the browser's own RegExp constructor, so what you see is what String.prototype.match will do in production rather than a server-side dialect with different rules. Matches are highlighted in place in the rendered paragraph, and a table underneath lists each one with its index and every captured group, named captures included. Two implementation details matter in practice: the global flag is forced on whatever you type, so the table always enumerates every hit instead of stopping at the first; and collection is capped at 500 matches, so a greedy pattern against a large document fills the table rather than locking the page. Invalid syntax surfaces as the engine's own wording. A sixteen-token reference panel loads any entry into the pattern field on click.
Test regular expressions against sample text with live match highlighting, group capture tables and common pattern reference. Supports all JavaScript regex flags.
Private Regex Tester In Your Browser
Regex Tester is processed locally with client-side JavaScript. Your files never touch a server, and there is no queue to wait in.
How to use Regex Tester
Enter the expression in the Pattern field and the flags in the Flags field; gm is the starting point and g is always added for you.
Edit the Test text, or use the sample paragraph already loaded to try the expression immediately.
Read the highlighted output for matches in context, then the table below it for each match's index and captured groups.
Click any entry in the cheat sheet panel to load it into the pattern field, and copy the current pattern from its panel header.
- Runs on the browser's native RegExp engine, so a pattern that behaves here behaves the same in client-side JavaScript.
- The global flag is appended before the expression is built, so the results table enumerates every match rather than only the first.
- Collection stops at 500 matches and zero-length matches step lastIndex forward, which removes the two ways a naive loop can hang.
- Sixteen reference tokens load into the pattern field on click, and the pattern currently in use is one button from the clipboard.
- A backend developer pastes a log excerpt and a candidate expression to see which lines match before adding it to a parser.
- Someone learning regular expressions works through the token reference and watches what a lookbehind does against a real paragraph.
- A developer debugging an extraction that returns the wrong substring reads the capture table to see which group is holding the value.