Regex Marble Run, built by developer [bottomless], turns regular expression parsing into a physical simulation. You input a regex pattern and a test string, and the tool generates a marble machine where each character of your string becomes a marble falling through gates representing each regex component. Matches land left, failures land right.

The site's demo expression, '^[hH]ack.[dD][^0-9]*$', is a useful teaching case. The tool forces you to watch anchors, character classes, negated ranges, and quantifiers operate sequentially on real input. The subtle behavior, where 'HackxDXYZabc123' partially matches until '$' kills it, is far easier to grasp visually than by reading a man page.

This is worth opening in a browser tab right now if regex syntax has ever felt opaque. The animated step-through exposes exactly why greedy quantifiers and end anchors interact the way they do. Read the full Hackaday piece for the walkthrough of each token, which doubles as a compact regex primer.

[READ ORIGINAL →]