Compile to DFA by repeatedly differentiating then unroll the machine? You'd still have back edges for the repeating sections.
Reply on news.ycombinator.com