lua-users home
lua-l archive

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


2017-04-22 9:30 GMT+02:00 steve donovan <steve.j.donovan@gmail.com>:
> On Fri, Apr 21, 2017 at 11:43 PM, Egor Skriptunoff
> <egor.skriptunoff@gmail.com> wrote:
>> "(.)%2" is an invalid pattern, but it could be applied to empty string
>> without an error.

I.e. you should do "pcall(string.match,str,pat)" instead of str:match(pat)
whenever either "str" or "pat" is not under your control.
   https://xkcd.com/327/