lua-users home
lua-l archive

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


There is no way to define that pattern in Lua. What I do is to use
an approximation and solve the details inside a "replace" function:

  string.gsub(s, "^%-?%d+(%.?%d?%d?)$", function (p, s)
    if s == "" or string.len(s) == 3 then ...

-- Roberto