News for hackers. Stuff that matters.
Re:Building a Regex Engine in Fewer Than 40 Lines of Code by perlgeek on Tuesday December 05, 2017 @05:48AM (#15851012)
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 :-)

Re:Building a Regex Engine in Fewer Than 40 Lines of Code by thesmallestcat on Tuesday December 05, 2017 @10:25AM (#15852240)
You can straight away drop any repetition of a zero-width assertion, no?
Re:Building a Regex Engine in Fewer Than 40 Lines of Code by perlgeek on Tuesday December 05, 2017 @12:16PM (#15853287)
You can, but you need to drop the entire zero-width assertion if the repetition allows zero occurrences.