Regex tester
2 matches
Runs in your browser · nothing is uploaded
Type a pattern and it runs against your text as you type: matches highlighted in place, capture groups listed with their positions, and a plain-English reading of what each piece of the pattern does. Replace and split are the same pattern applied a different way.
How to use the regex tester
This uses the browser’s own regular-expression engine, which is the same one your JavaScript will run against — so a pattern that works here works in your code, and one that does not will not. That is worth knowing because regex flavours genuinely differ: lookbehind, `\p{…}` properties and named groups all behave differently in PCRE, Python and POSIX, and a pattern copied from a PHP answer may simply not compile here. One pattern shape is refused rather than run. A quantifier nested inside a quantified group — `(a+)+`, `(\d+)*` — can take exponential time on input that nearly matches, and because the engine runs on the same thread as the page there is no way to interrupt it: the tab stops responding and the only fix is closing it. Rather than let that happen, the pattern is rejected with an explanation. The fix is almost always to make the inner quantifier possessive in spirit — match a specific character class instead of nesting repetition. The explanation panel walks the pattern and names each piece. It is a reading aid, not a parser: it does not build a tree or tell you what the pattern means as a whole, and it will not catch a logic error. It is there for the case everyone actually has, which is inheriting a pattern from a colleague and needing to know what `(?<=\s)` was for.
Questions
Yes, it is the browser’s own RegExp. A pattern that works here works in your code.