lua-users home
lua-l archive

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


> Yes, often the result of %d+ is used as a string in my code. Coercing it
> to a number would create more problems and/or inefficiencies (multiple
> unneeded conversions) than it would solve.

"%d+" in a pattern is the same thing as "[0-9]+". It means
"a series of figures". You certainly do not want to coerce
that to a number, because leading zeroes may be significant
(e.g. when extracting phone numbers from strings).

-- 
Pierre Chapuis