[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A bug in string.gmatch and string.gsub?
- From: Alexey Melnichuk <mimir@...>
- Date: Mon, 29 Apr 2013 18:21:07 +0400
Dirk Laurie <dirk.laurie <at> gmail.com> writes:
>
> Nothing in the description of `gsub` prepares the user for this:
>
> > print((string.gsub(";a;", "a*", "ITEM")))
> ITEM;ITEMITEM;ITEM
>
Pattern "a*" match empty string after each char and at the begin of string
Think about this :
print((string.gsub(";a;", "", "ITEM")))
May be you want : string.gsub(";a;", "a+", "ITEM") ?