lua-users home
lua-l archive

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


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