Module:Sandbox/Zyxw/test
Appearance
< Module:Sandbox | Zyxw
local p = {}
function p.main(frame)
local inputString = frame.args[1]
if inputString == '' then
return inputString
end
if not inputString:match('^%d{4} *%a{3,9} *%d{1,2}$') then
return inputString
end
local value1, value2, value3 = string.match(inputString, "^(%d{4}) *(%a{3,9}) *(%d{1,2})$")
return value3 .. ' ' .. value2 .. ' ' .. value1
end
return p