Anonymous user
Module:TableTools: Difference between revisions
From Roses, Tulips, & Liberty
p.affixNums: move the pattern-generating code out of the loop
(use a hack to handle NaN values) |
(p.affixNums: move the pattern-generating code out of the loop) |
||
Line 135:
prefix = prefix or ''
suffix = suffix or ''
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k,
if num then
nums[#nums + 1] = tonumber(num)
|