[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Suggestion: return nil in string.find/match() for indexes that are before the string
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 2 Mar 2014 21:40:48 +0200
2014-03-02 21:36 GMT+02:00 Thiago L. <fakedme@gmail.com>:
> Ok, you want a plain match, same rules apply: it doesn't care about the
> index, it'll just try to find the data, for index -30 and string "cat" -30
> would be translated into -27 (because string length - 30) and then it would
> still match as "cat" is still on the string (which's 30 chars long with a
> padding of 27 empty spaces on the left).
This is not what happens. There is no padding to the left. The -27 is
adjusted to be 1.