Tested tool guide
Tested browser tools
Checked August 16, 2026
What Regex Railroad Diagram does, with a checked example
A railroad diagram renders a regular expression as a track of boxes and forks read left to right: literals are labeled boxes, `|` alternatives are parallel tracks that split and rejoin, `?` adds a bypass, and `*` or `+` draw a loop back to the previous node. Each group becomes a labeled sub-diagram, so the pattern's nesting is visible at a glance. Paste a pattern and the tool lays out its structure. The common surprise: this is not a regex tester. It shows what the pattern says, not whether a string matches - and it exposes precedence, so `^a|b$` visibly splits into two anchored branches.
Worked example
A concrete input and expected output from the current implementation.
->
Expected output
A diagram that opens group 1 and immediately forks: one track reads c-a-t and the other d-o-g, and the two rejoin at the group's end. After the group, the single track passes through a box labeled 's' while a straight bypass track skips it, both meeting before the end of the line.
The `|` inside the parentheses draws one track per alternative, and `?` draws a zero-or-one bypass around the 's'. Reading the tracks end to end yields the four accepted strings: cat, cats, dog, dogs.