[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Baffling behaviour of string.match
- From: Dirk Laurie <dpl@...>
- Date: Tue, 14 Dec 2010 20:12:48 +0200
On Tue, Dec 14, 2010 at 07:32:40PM +0200, Peter Cawley wrote:
> On Tue, Dec 14, 2010 at 5:31 PM, Dirk Laurie <dpl@sun.ac.za> wrote:
> > I don't understand this.
> >> s='abbcd'; return a:match('b*')
> >
> >>
> > I expected the last match to be also "bb".
>
> The first position which "b*" can match at is the start of the string,
> where it matches "". There is a longer match later in the string, but
> the first match is "".
>
Ouch. Sorry about that. A clear sign that I should sign off for today.
Dirk