This small code piece can be part of bigger library
NFA and DFA.
https://github.com/parstools/regautomata1. Creating NFA from regexp (manually)
2. Creating DFA from NFA
restriction of last commit c7646dd1beaf4557a7a74d30be70d3d568be81b7 :
- manually build NFA, not parse regexp
- only one regexp, not multifinished DFA for lexical analyse