News for hackers. Stuff that matters.
Re:Building a Regex Engine in Fewer Than 40 Lines of Code by maweki on Tuesday December 05, 2017 @03:41AM (#15850599)
That does indeed implement grouping and alternative
Re:Building a Regex Engine in Fewer Than 40 Lines of Code by abecedarius on Tuesday December 05, 2017 @12:42PM (#15853625)
It's nicely coded but leaves out an important part of that algorithm: the regex derivatives never get simplified for comparison, so equal states appear different, so the set of states blows up as you march along the string. If you're OK with an inefficient matcher like that, then a backtracking algorithm probably gives you even simpler code.