Re:Regular Expression Engine in 14 lines of Python
by Wilfred on Sunday November 06, 2011 @06:33AM
(#3202403)
Interesting that it's on paste.lisp.org. It strongly reminds me of Emacs' rx macro. I suspect this a port of another toy regexp implementation -- otherwise I would expect the author to use `itertools.chain` rather than implementing something that does exactly the same (`iconcat` in this sample).
[ Parent
| on HN ]
Re:Regular Expression Engine in 14 lines of Python
by darklajid on Sunday November 06, 2011 @07:24AM
(#3202486)
Pasted by: psykotic
When: 5 years, 2 months ago
I don't know Python, but was your preferred choice available at that time?
Re:Regular Expression Engine in 14 lines of Python
by nknight on Sunday November 06, 2011 @07:32AM
(#3202498)
It was, though it was fairly new at that time, so the author may not have had it on his system.
Also, the Python standard library is quite large. Most people will never really know about all its nooks and crannies, and it's easy to forget they exist. I've accidentally reimplemented parts of it more than once.