Highlight Regex Matches
Enter a JavaScript pattern, choose flags, and review the matching portions of your text with clear visual highlights.
A QUICK WALKTHROUGH
How to use this tool
- Enter a pattern without slash delimiters and choose its flags.
- Paste the text to inspect, then select Highlight matches.
- Review the highlighted text and match count, or fix the reported syntax error.
Safe text rendering
Matches are highlighted with DOM elements created by the browser. Your text is never interpreted as HTML, so markup-like input remains visible text.
JavaScript RegExp behavior
The browser’s native JavaScript RegExp engine handles syntax, flags, Unicode behavior, and zero-width matches. Enable g to highlight all non-overlapping matches; without g, only the first match is highlighted.
Local limits
Processing stays in this browser. Pattern and text are each limited to 100,000 UTF-16 units, and at most 5,000 matches are rendered to keep the page responsive.
GOOD TO KNOW
Common questions
Does this support PCRE or Python patterns?
No. It uses the JavaScript RegExp implementation provided by the current browser.
Why is only one match highlighted?
JavaScript returns one match unless the g flag is enabled. Turn on g to highlight all non-overlapping matches.
Can my text be interpreted as HTML?
No. User text is inserted as text nodes, while only the tool-created highlight mark elements are rendered.
Are my inputs uploaded?
No. Matching and highlighting happen locally in your browser.