5 ms·
Hey hey, FWIW I wrote this up too (also in Python but in a different style, and without as many cool glyphs): https://joypy.osdn.io/notebooks/Derivatives_of_Reg
by carapace 4y ago
Hey hey, FWIW I wrote this up too (also in Python but in a different style, and without as many cool glyphs): https://joypy.osdn.io/notebooks/Derivatives_of_Regular_Expressions.html https://joypy.osdn.io/notebooks/Derivatives_of_Regular_Expre...
One neat thing is that the "compaction" rules to avoid exponential blowup are symmetrical (they form like, a ring or semi-ring or whatever, sorry I'm not a mathematician.) https://joypy.osdn.io/notebooks/Derivatives_of_Regular_Expressions.html#compaction-rules https://joypy.osdn.io/notebooks/Derivatives_of_Regular_Expre...
- c0nstantine 4y agoHi, thanks for sharing. Didn't know there is a python implementation. Your article is broader and I like the functional flavor. For the 'compaction' you mention, yes it is useful. But the code will be more complicated and optimization wasn't the point of the sketch.