Regex Tester – Build, Explain and Debug JavaScript Regular Expressions
A regex tester closes the gap between writing a regular expression and trusting it. You type a pattern, paste some sample text, and see at once what matches, what each capture group grabbed and where. This tester uses your browser's own JavaScript regex engine, so the results are exactly what String.prototype.matchAll, RegExp.prototype.exec and String.prototype.replace will return in your code, with no approximation or emulation.
Live matches, groups and offsets
Every match is highlighted in the editor, and each capture group gets its own colour, which is used for that group everywhere: in the text, in the pattern, in the table headers and in the diagram. The matches table lists each result with its start and end offset, its line and column, and the value of every group. A group that didn't take part in the match shows as "no match", which is different from a group that matched an empty string (""). Offsets count UTF-16 code units, just like match.index, so an emoji counts as two positions. You can copy the matches or export them as CSV.
Understand a pattern before you ship it
Regular expressions are dense, and a pattern you wrote last month can be hard to read today. The tester breaks the pattern into an explanation tree that describes each token in plain English, and draws a railroad diagram: a track that runs from left to right, splits at alternatives, loops back for repetition and boxes each capture group. Hovering a diagram node or an explanation row underlines the matching part of the pattern, so you can see which characters do what. One classic surprise is spelled out: in abc+, the + repeats only the c, not the whole word.
Warnings for common mistakes
Static checks flag patterns that are valid but probably wrong. [A-z] quietly includes six punctuation characters. a{,5} is literal text in JavaScript, not a quantifier. \A and \Z from other engines just match the letters A and Z. A stray | creates an empty alternative that matches nothing at all. Syntax borrowed from Python or PCRE, such as (?P<name>…), inline flags or possessive quantifiers, gets a hint that shows the JavaScript equivalent.
(a+)+ can take exponential time on text that almost matches. Every pattern here runs in a background Web Worker with a one-second limit, so a runaway pattern is stopped instead of freezing the page.Replace, test and export
The Replace panel applies a replacement string with JavaScript's own tokens: $& for the whole match, $1 or $<name> for groups, and $` and $' for the text before and after. Each inserted replacement is highlighted. The Tests panel keeps a list of strings that should match, should not match, or should match in full, and runs each one on a fresh regex so a leftover lastIndex can't skew the result. The Code panel produces ready-to-paste JavaScript for the literal, a test, a loop over all matches and a replace call.
Flags at a glance
Toggle g (all matches), i (ignore case), m (per-line anchors), s (dot matches line breaks), u and v (Unicode modes), y (sticky) and d (group indices). The tester checks which newer features your browser supports, such as the v flag, lookbehind, modifier groups like (?i:…) and duplicate group names, and tells you, rather than assuming a browser version.
Private by design
Nothing you type leaves your device. There is no server-side matching, and a share link stores the pattern, flags, text and tests after the # in the URL, a part browsers never send to a server. Because test text can be sensitive, keep in mind that anyone holding the link can read it. If a link is too long, the test text is left out first.
$ treats a final newline and whether \d covers non-ASCII digits, so test a pattern in the engine that will run it.