Modul:Wikidata utilities: Unterschied zwischen den Versionen

erster Wert
K kleinigkeiten
Zeile 6: Zeile 6:
end
end
local i = id:upper()
local i = id:upper()
if mw.ustring.match( i, '^Q[%d]+$') == nil then
if not mw.ustring.match( i, '^Q[%d]+$') then
if mw.ustring.match( i, '^[%d]+$') ~= nil then -- only number
if mw.ustring.match( i, '^[%d]+$') then -- only number
return 'Q' .. i
return 'Q' .. i
else -- invalid id
else -- invalid id