Re: Patterns: Why are anchors not character classes?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Patterns: Why are anchors not character classes?
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2015年7月19日 07:32:15 +0200
2015年07月18日 22:12 GMT+02:00 Sean Conner <sean@conman.org>:
> But this also works:
>
>> for word in line:gmatch"(%w+)%s*" do print(word) end
> No need for a patch unless you *want* a space or an end-of-line (or
> string) at the end of each word. If you want that, them I might suggest
> LPeg for your parsing needs.
I agree, of course. It's just that I like to test functionality extensions
by implementing them and discovering whether I continue using
them when the toy is not so new any more.
We may one day have LPeg in Lua itself. It was mooted by Roberto
as a candidate for 5.3. Enriching the present pattern syntax is not
supportive of that goal.