2 ms·
I used derivatives in the regex implementation in TXR. The derivative back-end is only used for regexes that contain the "exotic" intersection and complement op
by kazinator 8y ago
I used derivatives in the regex implementation in TXR. The derivative back-end is only used for regexes that contain the "exotic" intersection and complement operators. (Or the non-greedy repetition which transforms to intersection and complement at the AST level).
http://www.kylheku.com/cgit/txr/tree/regex.c http://www.kylheku.com/cgit/txr/tree/regex.c
The derivatives implementation starts with the appearance of the function reg_expand_nongreedy.
Wow, I see that in reg_derivative where it handles compound forms, I'm testing for some vanishingly improbable internal-error cases upfront: presence of uncompiled character classes. Fixed that.