Module:Sandbox/Hellknowz/Test: Difference between revisions

Content deleted Content added
0 or 1
okay just straight variables since these indices are so messy
Line 36:
local input = args[1]
 
local matchmatchDay, =matchMonth, {matchYear = input:match('^([0-9][0-9]?) ([A-Za-z]+) ([0-9][0-9][0-9][0-9])$') }
 
if (matchmatchDay == nil) then return input .. ' -> is not a recognized pattern match' end
--return match[1]matchDay .. '-' .. match[2]matchMonth .. '-' .. match[3]matchYear
 
--[[
local month = monthIndices[match[2]:lower()]
 
local month = monthIndices[match[2]matchMonth:lower()]
if (month == nil) then return input .. ' -> does not have a recognized month name' end
 
local day = match[1]matchDay:tonumber()
local year = match[3]matchYear:tonumber()
 
return input .. ' -> parsed to ' .. year .. '-' .. month .. '-' .. day; -- won't add 0s
 
]]
end