end
function functions:namecall.iloveregexold(data)
local r = "%[?%[?.-:([^{|]+)%]?%]?"
return mw.ustring.match("[[File:Hey.jpg|thumb|left|250px]]",r)
end
function functions :RawInfo.iloveregexold( data) ▼
local r = "%[?%[?%a-:([^{|]+)([^]]*)?%]?%]?"
local function Dump(t,depth,result,indent,recursion)
return mw.ustring.match("[[File:Hey.jpg|thumb|left|250px]]",r)
local depth = depth or 10
local result = result or ""
local indent = indent or 2
local recursion = recursion or {}
result = result .. "Dump start\n"
for a,b in next,t do
--Indent the table
result = result .. "D"..string.rep(" ",indent)
--Represent the key (we dont expand table keys)
if type(a) == "string" then
result = result .. "\""..a.."\""
else
result = result .. tostring(a)
end
result = result .. ": "
--Represent the value
if type(b) == "string" then
result = result .. "\""..b.."\""
elseif type(b) == "table" then
if depth == 0 then
result = result .. tostring(b) .. "[ Depth limit ]"
elseif recursion[b] then
result = result .. tostring(b) .. "[ Recursion ]"
else --Dump the table inside
recursion[b] = true
result = result .. Dump(b,depth-1,"",indent+2,recursion)
end
elseif type(b) == "nil" then
result = result .. "nil"
else
result = result .. tostring(b)
end
--Finalise line
result = result .. "\n"
end
return result
end
▲function functions:RawInfo()
function functions:namecall()
return "<sytaxhighlight lang=text>\n"..Dump(self,5).."</syntaxhighlight>"
end
|