Some examples from real life. Patterns to copy and as templates to further develop. I tried to describe how I came up with the solution. So everybody can understand the (thus my) logic, and bend the example for the own requirements. Of course, my solutions are not the last resort. There is certainly very often another, perhaps also a more beautiful, faster, better solution.
With the input pattern the input of the user should be checked already during the input. At least the pattern must be correct. Often they are not, therefore a few negative examples. As always without guarantee!
Sorry- we work on it!