lua-users home
lua-l archive

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


I have lua embedded in system where users can define table of variables and
then write expressions to process them. However i think it would be
reasonable to have some sanity checks in place, so i don't have to explain why formulas using variable called "TIME-MAX" are not working :-) and stuff
like that...

Up to reserved words, the Lua pattern "^[%a_][%w_]*$" should do the job.

-- Roberto

Haha cool, i was thinking that somehow calling string.find() using C api might be possible solution... not super elegant, but much more reasonable than using C regexp library just for this one thing...

T.

--
S pozdravem
Best regards
     Tomáš Mudruňka - SPOJE.NET s.r.o.