Regex Tester
Test JavaScript regular expressions against sample text: every match, index, and capture group listed. Nothing you test is uploaded.
Private by construction. The conversion happens in this page's JavaScript. Nothing you paste here leaves your machine, and the tool keeps working with the network unplugged.
The first line of the input is your pattern — either /pattern/flags or a bare pattern — and everything below it is the text to search. The output lists every match with its character index, plus every capture group, numbered and named. This is the actual JavaScript regex engine, not an approximation, so what matches here matches in Node and the browser: lookaheads, named groups (?<name>…), and Unicode escapes with the u flag all behave exactly as they will in your code. Regex testers are where people paste production log lines and API responses; this one keeps them on your machine.
Questions this tool gets asked
Which regex flavor is this?
JavaScript's, exactly - the tool runs your pattern through the browser's own engine. Perl/PCRE features that JavaScript lacks (possessive quantifiers, recursion) won't work here, and won't work in your JavaScript code either, which is the useful truth.
What flags can I use?
Any JavaScript flags: i (ignore case), m (multiline ^ and $), s (dot matches newline), u (Unicode), and g. The g flag is always applied so every match is listed, not just the first.
What does “@12” mean in the output?
The character index where that match starts, counting from 0 at the beginning of the text (line breaks count as one character). Indexes are what String.match and exec return, so they line up with your code.
Why does my pattern match empty strings repeatedly?
Patterns where everything is optional (like a*) match the empty string at every position. The tester steps past empty matches to avoid looping forever, but the fix is a pattern that requires at least one character, like a+.