lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, Jan 13, 2018 at 3:06 PM, Paige DePol <lual@serfnet.org> wrote:
> steve donovan <steve.j.donovan@gmail.com> wrote:
> Except, like anything you do with repetition, it becomes much easier to
> read and understand over time.

This is probably true for any hard thing, like an organ player reading
left hand, right hand
_and_ foot pedals.  The question is, what is more maintainable for
normal people who can only read one line of music at a time?

> Also, if you use the /x modifier you can
> ignore whitespace and add comments right in the regular expression!

The Rust flavour of regexp works like that, nice design.  Adds more
than 400kb to "hello world" though and some crates have deliberately
dropped it as a "too heavy" dependency.  So I wrapped the 400 lines
(!) core of Lua pattern matching as a little crate, lua-patterns.

> [1] PCRE = Perl Compatible Regular Expressions.   https://www.pcre.org/

Fun fact: the PCRE implementation is rather larger (390K) than Lua 5.2
(195K) on my system.