Module:Sandbox/Hellknowz/Test: Difference between revisions

Content deleted Content added
#
let's try this
Line 36:
local input = args[1]
 
local match = { input:match('^([0-9][0-9]?) ([A-Za-z]+) ([0-9][0-9][0-9][0-9])$') }
 
if (match == nil) then return input .. ' -> is not a recognized pattern match' end
 
return #match
 
--return match[1] .. ' - ' .. match[1] .. ' - ' .. match[2]
 
--[[
local month = monthIndices[match[2]:lower()]
 
Line 50 ⟶ 45:
 
local day = match[1]:tonumber()
local year = match[13]:tonumber()
 
return input .. ' -> parsed to ' .. year .. '-' .. month .. '-' .. day; -- won't add 0s
]]
 
end