[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Static validation of Lua String Patterns?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 22 Apr 2017 11:46:11 +0200
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/