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

Absolutely! Even worse, you may get different results than the expected method (FSA compilation) would yield. Observe:

Javascript, executed in the console of a recent Chrome:

    > 'ab'.match(/a|ab/)  
    ["a"]
BSD Grep:

    > egrep 'a|ab' <<< ab  
    ab


Yow...

I was under the impression that all major regex engines used NFAs converted to DFAs lazily, with fallbacks to a slower engine for features that cannot (or cannot practically) be implemented using an NFA (unbounded backtracking, that sort of thing.)

What is the advantage to doing this?




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

Search: