Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think one of the reasons is the ".+z" gets bigger and uglier after you convert it to a deterministic automaton.


They show the DFA for it on the site, it's 3 states. There's a starting state for the first . and then two states that transition back and forth between whether z was the last character or not.

I think what's actually happening here is that they're doing the intersection on the DFAs and then producing a regex from the resulting DFA. The construction of a regex from a DFA is where things get ugly and weird.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: