[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.match(s, pattern, [init], WHY NOT [len])
- From: Patrick Donnelly <batrick@...>
- Date: Wed, 11 Jul 2012 20:44:04 -0400
On Wed, Jul 11, 2012 at 7:39 PM, Nikolay Kostadinov <spior96@gmail.com> wrote:
> This would make my life so much easier. Seriously why doesn't string.match
> have a len argument? It's so useful.
Reasonable patterns can limit the length of what they match. If you
want 1 to maximum 3 space characters, you can easily do:
%s%s?%s?%s?
For more advanced pattern matching, use something like lpeg or a pcre
binding. Lua pattern matching is not intended to solve all problems.
> The page said this was the place for suggestions so yea.
What page? We aren't looking over your shoulder reading your browser.
--
- Patrick Donnelly