4 ms·
A regexp matcher in less than 30 lines of code
- viebel 10y ago1 point by viebel 14 hours ago [-] This article is an interactive version of the first part of this paper: Parsing with derivatives - a Functional Pearl - the part that shows how to implement a regular expression matcher in a few lines of code using a concept from 1964 named Brzozowski's derivative. In this article, we are going to implement a regular expression matcher in clojure using Brzozowski's derivative. The theoretical part is a bit abstract but it worths making the effort as the implementation is really elegant.