3 ms·
I think syntax is the big whiff in regular expressions. I bet it would feel much more natural to represent them not as a string but as a tree (which they kind o
by Boxxed 7y ago
I think syntax is the big whiff in regular expressions. I bet it would feel much more natural to represent them not as a string but as a tree (which they kind of are). Maybe with s-expressions? Would probably be more verbose but I imagine way more readable.
- mikece 7y agoS-expressions which make me think of Lisp and functional programming... which I mention because regular expressions as means for defining a pattern against which to find matches has a functional programming feel to it. Perhaps something like Linq in .NET or Map() in JavaScript would work as you're more or less converting the text in a string/document to an array and then running a "does it match or not" function on it and returning the position when there's a match. So something which a functional programming feel makes sense.