Regex Tester Playground

Catalogue search: type a pattern and flags, every match is framed and every group coloured. A pattern that hangs is stopped, the page keeps running. An…

Why it matters

Regexes live in form validation, search, log reading, find-and-replace. They are feared for being abstract, but once the matches light up, the pattern makes sense. Plus three traps that often become bugs: lastIndex with the g flag, an unescaped dot, and a pattern that hangs.

The key idea

A regex matches the shape of text; the g flag and capture groups confuse the most

Try it in this playground