Regex Tester
Test JavaScript regular expressions live: highlight matches, see indexes and capture groups, toggle g, i, m, s, u, y flags and get clear syntax errors.
Test JavaScript regular expressions live: highlight matches, see indexes and capture groups, toggle g, i, m, s, u, y flags and get clear syntax errors.
Regex Tester runs your regular expression against sample text using the JavaScript RegExp engine built into your browser. Matches are highlighted in place and listed with their index positions, lengths and capture groups, including named groups.
Each flag — g, i, m, s, u and y — can be switched on or off, and any flag your browser does not support is disabled. Invalid patterns show the browser’s own syntax-error message, and patterns that run for too long are stopped automatically instead of freezing the page.
Because the test uses JavaScript (ECMAScript) rules, results match what you will see in browser and Node.js code. Other engines such as PCRE, Python or Java can behave differently.
JavaScript (ECMAScript), as implemented by the browser you are using. It is the same engine used by RegExp in your front-end code and, for most features, by Node.js.
Some syntax from other engines is not part of JavaScript regex, such as possessive quantifiers (a++), atomic groups (?>…) or inline modifiers like (?i). Rewrite those parts using JavaScript-compatible syntax.
Without the g (global) flag, JavaScript returns only the first match. Turn on g to find all matches.
The pattern took too long on your text — usually a sign of catastrophic backtracking from nested or overlapping quantifiers. The test is stopped so the page stays responsive; simplify the pattern and try again.
No. Matching runs in a Web Worker inside your browser tab. Nothing is uploaded or stored.
Zero-length matches (for example from ^ or \b on their own) appear as a thin red marker in the highlighted text and as “(empty string)” in the match list.