ako... wrote:
> i suspect that from your trivial solution we can arrive at the final
> solution by just performing a DFA minimization. the same thing that
> lex and yacc do when they generate code. so i guess i have answered
> my own question. thanks for helping me. your trivial solution just
> made my brain work.

Another option is to build up a tree and create the RX from that.  I once
wrote that:

14:12:23 [c]: ( echo foo; echo bar; echo band ) | create-rx.rb
(?:ba(?:nd|r)|foo)

Kind regards

    robert