[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A bug in string.gmatch and string.gsub?
- From: Finn Wilcox <finnw@...>
- Date: Mon, 29 Apr 2013 17:44:25 +0100
On 29/04/2013 17:17, Scott Morgan wrote:
> Even odder....
>
> Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> > =(";a;"):gsub("a-", "ITEM")
> ITEM;ITEMaITEM;ITEM 4
>
> Why is that 'a' still there?
>
I don't think this one is a bug. "a-" prefers to match the empty string
if possible, and that is all it does here (i.e. matches the 5 distinct
empty substrings of ";a;".)
Finn