nearly-working regex -> dfa -> minimal dfa