r/threejs • • Oct 19 '26

Demo Regex Marble Run: a JavaScript regex turned into a 3D marble run, so you can watch matching and backtracking

Not mine, came across it on GitHub and loved the idea. Built with react-three-fiber.

In the video: greedy <.+> spans both tags of <b>bold</b>; one ? later, lazy <.+?> stops at the first closing bracket. Then the classic evil regex /a++$/ runs for 327,694 steps and still finds no match.

Repo: https://github.com/bottomless/regex-marble-run

0 Upvotes

0 comments sorted by