Regex Tester with Live Match Highlighting
Test regex patterns against sample text with real-time highlighting. See match groups, captures, and all JavaScript regex flags.
Runs in your browser. No data leaves your device.
Frequently Asked Questions
How does the Regex Tester work?
The tool compiles your pattern into a JavaScript RegExp object with the selected flags (g, i, m, s, u). It then runs String.matchAll() against your test text to find all matches, including capture group contents and their start/end indices. Matches are highlighted in the text display using character-position offsets, and group details are rendered in a separate panel. Invalid patterns are caught by the RegExp constructor and reported as syntax errors.
What regex flavor does this use?
It uses JavaScript's built-in RegExp engine, which supports features like lookahead, lookbehind, named capture groups, and Unicode property escapes. This is the same regex engine used in Node.js and all major browsers.
What are regex flags like g, i, and m?
The "g" flag finds all matches (not just the first), "i" makes the pattern case-insensitive, and "m" makes ^ and $ match the start and end of each line instead of the entire string. You can toggle these in the flags panel.
How do I see capture groups?
Parentheses in your pattern create capture groups. The match details panel shows each group's content and index. Named groups use the syntax (?<name>...) and are shown by name in the output.