Module:Random choice

local p = {} local getArgs = require("Module:Arguments").getArgs function p.main(frame) args = getArgs(frame) s = args[1] math.randomseed(os.time) i = math.floor(math.random*#s) j = i+1 while (string.sub(s, i, i) ~= "|" and i > 0) do		i = i - 1 end while (string.sub(s, j, j) ~= "|" and j < #s) do		j = j + 1 end return string.sub(s, i+1, j-1) end

return p