JavaScript Regex Tester
Test a JavaScript regular expression against text and see exactly what matched, instantly in your browser. JavaScript (ECMAScript) syntax only — not PCRE, Python, .NET, Java, Ruby, or Go.
Uses native JavaScript replacement syntax: $& (whole match), $1, $2… (groups), $<name> (named group), $$ (literal $).
Your pattern, flags, test text and matches are processed in this browser and are never sent to Docspira. Learn more.
About this tool
This tool runs your pattern with the browser's own, unmodified JavaScript (ECMAScript) regular expression engine — the exact same engine and flags (g, i, m, s, u, y, d) your JavaScript code would use, nothing more and nothing less. It does not explain or diagram your regex, does not generate a regex from a description, and does not attempt to certify a pattern as safe from catastrophic backtracking — it only bounds how long a single test can run (the evaluation is isolated in a background worker with a timeout) and how many matches are shown at once (the first 1000). It is not a PCRE, Python, .NET, Java, Ruby, or Go regex tester — those flavors differ from JavaScript's in real, sometimes subtle ways.