https://jvns.ca/blog/2016/04/24/how-regular-expressions-go-f....
https://jvns.ca/blog/2016/04/24/how-regular-expressions-go-f....
As an example basic HTML cannot (?) be parsed by RegExp because tag-pairs can contain tag-pairs:
<div> <div> </div> </div>
eludes RegExp matching, it seems to me, because a typical standard RegExp would only match "<div> <div> </div>" and would not see the 2nd </div>.Can RegExp Derivatives do it better?
Derivatives of RegExps don't automatically unlock parsing of context-free grammars, afaik. For that you need recursion. They do however unlock some very elegant parser designs.
Conor McBride, The Derivative of a Regular Type is its Type of One-Hole Contexts
http://strictlypositive.org/diff.pdf
related to Huet's Zipper and Hinze, Paterson Finger Trees, with a huge of follow-on literature:
https://personal.cis.strath.ac.uk/conor.mcbride/Holes.pdf
https://conal.net/blog/posts/differentiation-of-higher-order...
and numerous old posts by sigfpe (Dan Piponi), e.g.
http://blog.sigfpe.com/2008/06/blessed-mans-formula-for-hole...