Regex Tester
Test a regular expression against sample text, with matches highlighted live as you type. See every match and its capture groups.
Flags reference
g global (find all matches, always applied here internally), i case-insensitive, m multiline (^ and $ match line boundaries), s dotAll (. matches newlines), u unicode, y sticky.
How it works
Your pattern is compiled with the browser's native RegExp engine, the exact same engine your JavaScript code will use in production. That's the point of testing here rather than in a PCRE-based tool: syntax that differs between flavors (lookbehind support, \d semantics under the u flag, named groups) behaves here exactly as it will in Node or the browser. The flags field is sanitized to the valid set (d g i m s u y), and the tester quietly adds g internally so it can walk every match, without changing what you typed.
Matching runs on every keystroke: the tester calls exec() in a loop, collecting match text, position, and capture groups. Two guards keep it honest: zero-length matches (from patterns like a*) get a manual index bump so the loop can't spin forever, and iteration caps at 5,000 matches. Highlighting is built by walking your test string once and wrapping each matched span, with all text HTML-escaped first so a match containing <script> renders as text, not markup.
Everything stays in your tab; the Network panel in DevTools shows zero requests while you type, so test strings with real data in them never leave your machine.
One gotcha worth knowing: nested quantifiers like (a+)+$ can trigger catastrophic backtracking, where match time explodes exponentially on a long almost-matching input. If the page freezes on a pattern like that, it's not the tool, it's the regex, and it will hang your production code the same way. Rewrite the pattern so quantified groups can't match the same characters in multiple ways.
Common questions
Does this use JavaScript regex syntax?
Yes, since it runs in your browser using JavaScript's native RegExp engine. That's the same syntax used in Node.js and most browser-side code, close to but not identical to PCRE (used by PHP, Python's re module differs slightly too).
Why does it always seem to act like the global flag is on?
So every match gets found and highlighted rather than stopping at the first one. Whatever you type in the flags field is still respected for everything else (case sensitivity, multiline, etc.), the global behavior is just always applied for finding all matches to display.
Is my test string sent anywhere?
No, matching happens entirely in your browser's JavaScript engine. Nothing is uploaded.