Hacker News new | past | comments | ask | show | jobs | submit login

>Can you show me the research that states how to add things like complement and intersection to general purpose regex libraries?

>Most regex engines are backtracking based, and in that context, adding complement/intersection seems pretty intractable to me.

Most regex engines, using backtracking, already have it in the form of lookarounds. The performance penalty of such a strategy is often quite significant. Lookarounds are hard to automatically convert into intersection and complement, but if such primitives were exposed to the programmer, they could often reimplement their regexes in terms of them. It might occasionally lead to an unacceptable performance cost, but there would be many cases where it would be a desirable tradeoff.




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

Search: