About this tool
Regular expressions are powerful but notoriously easy to get subtly wrong. This tool lets you test a pattern against real sample text and see exactly what it matches, with common flags toggleable.
How it works
- Type your pattern (without slashes) into the pattern field.
- Toggle flags — g, i, m, s — to change matching behavior.
- Paste sample text below; matches are highlighted live using JavaScript's native RegExp engine.
Frequently asked questions
What regex flavor does this use?
JavaScript's native RegExp engine (ECMAScript regex syntax) — the same one used in browsers and Node.js.
Why aren't all matches highlighted?
Without the global (g) flag, only the first match is returned, matching how JavaScript's String.match behaves by default.