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

Theoretically, a regular expression can be expressed in constant space, and that's profoundly limiting, so anything that requires so much as a stack is not a regex.

That includes basic things like capture groups. That doesn't mean you can't use automata in a regex-plus implementation, though.

I can't find the paper, but I think there is a hybrid engine that tries to get the best of both worlds; constant space where possible and using additional space to provide more features.




You can implement capture groups with no problem using automata (see re2).

You might have meant to say that you can't use backreferences.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: