JavaScript Regex Tester
Test JavaScript regular expressions against your text and see every match highlighted as you type. The tester uses the browser's built-in RegExp engine, so behaviour matches exactly what your JavaScript code will see at runtime. Runs entirely in your browser.
MODE
How it works
The tool uses the browser's native JavaScript RegExp engine. Patterns are compiled with new RegExp(pattern, flags) and results are computed synchronously. Invalid patterns show an error badge, they never crash the page.
Processing runs in your browser
Both the pattern and the test string are processed entirely in your browser. Our servers are not involved at any point.
Related operations
For plain substring swaps without regex, try find and replace. To validate JSON patterns you are matching, use the JSON formatter. For decoding escape sequences in HTML attribute values, see HTML entities.
Frequently asked questions
- Which regex flavour does this use?
- JavaScript (ECMAScript) regular expressions, the same engine your browser uses to run JS. Syntax follows the ECMAScript 2023 specification, including lookbehinds, named groups, and Unicode property escapes.
- Which flags are supported?
- The four most common JavaScript flags: g (global), i (case-insensitive), m (multiline), and s (dotAll). Toggle each flag with a button next to the pattern input.
- What happens if my regex is invalid?
- An inline error message appears below the pattern input describing the parse error. The page stays responsive and you can edit the pattern until it parses cleanly.
- Is my text sent to a server?
- All processing runs in your browser using the native JavaScript RegExp engine. Our servers are not involved at any point.