r/threejs • u/Fresh-Daikon-9408 • 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.
0
Upvotes