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

Thad first one doesn't seem very good. It seems like there are many places states could be merged. Eg, there are 4 different "^0" states and 3 "^1" states. or am i misreading something?


Amazing how being able to visualize the problem reveals available optimizations!


A regular regex doesn't need to be optimized how it is written if the matcher is dfa based because the minimal dfa is unique. Regex engines however are more complex than that, and the structure this shows isn't going to be how it is actually recognized.

This should reallt only be used for understand what regex matches, not as am optimization tool. In that regard it should display the simplest graph possible to aid understanding.




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

Search: