A regular expression is visualized via a railroad diagram.
You will notice that this is the same type of visualization than a language grammar. This is because they are implemented with regular expression when parsing the code.
This library implement specifically a translation from a regular expression to a railroad diagram