Regex Tester is a free online tool for writing, testing, and debugging regular expressions against sample text in real time. Enter a pattern and see every match highlighted inline, with a live match count and each captured group's value broken out separately, so you can confirm exactly what your expression does before it goes into production code.
Regular expressions are compact and powerful, and that compactness is exactly what makes them so easy to get subtly wrong. A quantifier without a bound (like + instead of {1,4}) can match far more than intended; an unescaped special character (a literal . or ( that should have been \. or \() silently changes what the pattern matches; and greedy quantifiers by default consume as much text as possible, so .*" in a pattern meant to grab one quoted string can jump all the way to the last quote in the line instead of stopping at the first one. None of these mistakes throw an error — the regex still runs, it just matches the wrong thing, and that kind of silent failure is far more expensive to track down after the fact than a syntax error would be.
This tool exists for the iteration loop that precedes shipping a pattern: type a candidate expression, see immediately what it matches against representative input, adjust, repeat — all without re-running a script, restarting a server, or adding a temporary console.log to a codebase. It supports the full set of JavaScript regex flags: g (global, find every match instead of stopping at the first), i (case-insensitive matching), m (multiline, so ^ and $ anchor to line boundaries instead of only the start and end of the whole string), and s (dotAll, so . also matches newline characters, which it does not by default). Each flag can be toggled independently so you can see exactly how adding or removing one changes the match set.
Capturing groups — the parenthesized parts of a pattern — are extracted and listed separately for every match, which is often the fastest way to spot a group that is capturing the wrong span, an off-by-one in a nested group, or a group you meant to make non-capturing with (?:...) but forgot to.
Everything runs on the native JavaScript RegExp engine built into your browser — the same V8-based engine that runs in Node.js and Chrome — so a pattern that works here will behave identically once you copy it into actual application code. There is no server call and no data transmission, which matters because regex testing frequently involves pasting in real log lines, API responses, or database rows that you would rather not send to a third-party server.
Testing a pattern against a log line or API response? JSON Formatter makes that payload readable first.