There are a few improvements I think are needed for regex diagrams:
- Special escapes should indicate the characters they are indicating somehow? for example instead of displaying \d, some indication that any diget is allowed... I am not sure about this one.
- Octal and unicode escapes should show the unescaped character (as well/instead?).
- Range looks a lot like a literal... maybe include min and max seperatly with an arrow? Open to ideas on this one... but [a-z] should not look like "a-z" it should look like an "a" with an indication its the min, with an association with the "z"... I hope that makes sense.
- Catagories are displayed with the \p{} stuff in it with some change in the box to indicate its a category... I would only display the Catagory name "Letter" for example.
- Support for inline comments should be included: "a(?#The fist latin letter)" should comment the "a"... I have seen other syntax, so open to debate if others would like another syntax.
- \Q and \E indicate start and stop of literal text, and should not show up in the diagram for letteralCharacterSequence, other then that it looks great... keep in mind "\Qa|b\E" should be the literal text "a|b" NOT an alteration.
- Octal escapes should not require a 0 prefix... "\337" is an octal escape, and should allow numbers until there it finds a non number.
- Be sure to check that the "\\" escapes to "\"