[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: pmatch library
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 16 Nov 2000 11:12:14 -0200
> Is there a good reason why this couldn't be added to standard Lua patterns?
I don't know how to do it in a *simple* way. Notice that, unlike most other
pattern-matching implementations, Lua does not use FSA; on the other hand,
the whole implementation has less than 400 lines (versus > 2000 for typical
FSA implementations). Also, the pattern-matching in Lua has some features
that can't be done (I guess) with FSA (such as %b and .-). So, I still
think the best solution is to keep Lua with a standard small implementation
for pattern-matching, and to add a new library with a full
regular-expression implementation. Unless, of course, someone finds a good
way to implement alternation into the current (recursive) style.