Regex Tester
Write and test regex live, with match highlighting and captured group explanations.
Match highlighting
No matches.
About: Regex Tester
This regex tester runs your regular expression live against any text: every match is highlighted and captured groups are listed with their positions. It uses JavaScript's own RegExp engine, so what works here works in your browser code or Node.js. It helps when you're tuning a form validation, pulling values out of a log file, or trying to understand a pattern someone else wrote. A built-in cheat sheet inserts syntax for you.
Features
- Real-time highlighting of every match in your text, with its start index, end index and length.
- Captured groups listed for each match, with empty groups clearly marked.
- All six JavaScript flags (g, i, m, s, u, y) as checkboxes, each explained in a tooltip.
- A filterable reference panel (anchors, quantifiers, groups, lookarounds…) that inserts the chosen token at the cursor.
- Catastrophic backtracking guard: a pattern running longer than one second is stopped without freezing the tab.
How to use it
- Type your regular expression in the top field, without the surrounding slashes.
- Tick the flags you need, such as g for all matches or i to ignore case.
- Paste the text to test and watch matches highlight as you type.
- Check the captured groups on the right, or open the reference panel to insert a token.
Questions about usage
Your browser's JavaScript RegExp engine, so syntax and behavior follow JavaScript, including named groups, lookbehind and the Unicode flag. Some constructs specific to PCRE or Python, such as atomic groups or possessive quantifiers, may be rejected.
No. Matching runs in a Web Worker inside your browser and nothing goes to a server. The pattern, flags and text are stored in the page URL, so reloading or reopening the link brings you back to the exact same state.
If matching takes more than one second, the tool stops it. That usually means catastrophic backtracking, caused by nested quantifiers like (a+)+ on a long string. Rewrite the pattern to avoid ambiguous repetition. When there are more than 10,000 matches, only the first ones are shown.