About this tool
Write a JavaScript regular expression, set flags, and see every match highlighted in your test text instantly, with capture groups listed for each match. Invalid patterns show the engine's error message rather than failing silently.
Regex is famously easy to get almost right. A live tester closes the loop: you see immediately whether your pattern over-matches, under-matches, or backtracks into matching nothing. The tester uses your browser's native JavaScript engine, so behavior is exactly what your JS code will do.
How to use it
- Enter a pattern (without surrounding slashes) and flags such as g, i, m.
- Paste sample text to test against.
- Review highlighted matches and capture groups; adjust until correct.
Frequently asked questions
Which regex flavor is this?
JavaScript (ECMAScript), as implemented by your browser. Most patterns transfer to other flavors, but lookbehind, named groups and Unicode properties vary across languages.
What does the g flag do?
Global — find all matches instead of stopping at the first. Without it the tester reports only the first match.
Why does .* not match across lines?
The dot excludes newlines by default. Use the s (dotAll) flag, or match [\s\S] instead.