lua-users home
lua-l archive

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


= re.match("aaand", "[a]^2")
.\re.lua: attempt to perform arithmetic on local 'p' (a string value)

the fix is simple, just make sure class range ALWAYS return lpeg object

Since class complement function always run, just fix it:

< function(c, p) return c == "^" and any - p or p end
---
> function(c, p) return c == "^" and any - p or m.P(p) end

redo above
= re.match("aaand", "[a]^2")
3