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

In my experience, it's the edge cases that are a pain when implementing a regex engine. Think about weird regexes like "^*", "$?" (or any quantified zero-width match), anchors that appear in the middle of regexes, nested quantifiers (don't make much sense, but you need to generate good error messages).

Once you add captures and maybe even backreferences, you get a whole new world of weird :-)



You can straight away drop any repetition of a zero-width assertion, no?


You can, but you need to drop the entire zero-width assertion if the repetition allows zero occurrences.




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

Search: