[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.3.3 empty match behaviour with the '-' modifier
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 12 May 2016 15:22:07 +0200
2016-05-12 14:56 GMT+02:00 Roberto Ierusalimschy <email@example.com>:
>> Lua 5.3.3 Copyright (C) 1994-2016 Lua.org, PUC-Rio
>> > =(";a;"):gsub("a-", "ITEM")
>> ITEM;ITEMaITEM;ITEM 4
>> I.e. the substring 'a' in ";a;" is not recognized as an instance
>> of the pattern "a-".
> The substring 'a' is not an instance of the pattern "a-", given that
> '' is also valid and shorter than 'a'. So, this behavior seems correct.
Must we conclude, therefore, that the '-' modifier as the last character of
a pattern will never match any character of the class it modifies?