Module:Sandbox/PatternTest

local p = {}

function p.test return "Hello, world!" end

function p.test2 date = "17/7/1990" _, _, d, m, y = string.find(date, "(%d+)/(%d+)/(%d+)") return d, m, y end

function p.test3 result = string.gsub( "Hello, world!", "world", "Satan") result = string.gsub( "Hello, world!", "%l", "x") return result end

function p.test4 result = string.gsub( "Hello, world!", "world", "Satan") result = string.gsub( "Hello, world!", "%l", "x") return result end

function p.test5 result = ":佐藤綾 (1995年) :石田亜佑美 (1997年)" result = string.gsub (result, "%p(%d%d%d%d)年%p", "(DA YeAR is %1!)") return result end

function p.test7 result = ":佐藤綾 (1995年) :石田亜佑美 (1997年)" result = string.gsub (result, "%p(%d%d%d%d)年%p", "") return result end

function p.test6 theinput = "" result = string.gsub (theinput, "%p(%d%d%d%d)年%p", "(DA YeAR is %1!)") return result end

function p.test8 theinput = frame:expandTemplate{title='Birthday January 7'} result = string.gsub (theinput, "%p(%d%d%d%d)年%p", "(DA YeAR is %1!)") return result end

function p.test9 return frame:expandTemplate{title='Birthday January 7',args={1,2,3}} end

return p