Module:Sandbox/Hellknowz/Test: Difference between revisions

Content deleted Content added
undefined?
flag after
Line 751:
-- note that we can't just replace matches with whitespace and catch them all, because it could be like '3 August<!---->20<ref/>12'
local matchStrip = value:match('^([^<]+-)<ref[^>]*>[^<]*</ref><ref[^>]*>[^<]*</ref><ref[^>]*>[^<]*</ref>$') -- basic refs (quite common)
if (matchStrip) then return trim(matchStrip) end
 
matchStrip = value:match('^([^<]+-)<ref[^>]*>[^<]*</ref><ref[^>]*>[^<]*</ref>$') -- basic refs (quite common)
if (matchStrip) then return trim(matchStrip) end
 
matchStrip = value:match('^([^<]+-)<ref[^>]*>[^<]*</ref>$') -- basic refs (quite common)
if (matchStrip) then return trim(matchStrip) end
matchStrip = value:match('^([^<]+-)<ref[^>]*/><ref[^>]*/><ref[^>]*/>$') -- basic named ref (quite common)
if (matchStrip) then return trim(matchStrip) end
matchStrip = value:match('^([^<]+-)<ref[^>]*/><ref[^>]*/>$') -- basic named ref (quite common)
if (matchStrip) then return trim(matchStrip) end
matchStrip = value:match('^([^<]+-)<ref[^>]*/>$') -- basic named ref (quite common)
if (matchStrip) then return trim(matchStrip) end
Line 772:
if (matchStrip) then return trim(matchStrip) end
matchStrip = value:match('^([^<]+-)<!--.--->$') -- comment after (sometimes used for notes to editors)
if (matchStrip) then return trim(matchStrip) end
Line 779:
 
matchStrip = value:match('^{{[Ff]lag ?icon[^}]+}}([^<]+)$') -- flag icon (quite common, although against MOS:ICON)
if (matchStrip) then return trim(matchStrip) end
matchStrip = value:match('^([^<]-){{[Ff]lag ?icon[^}]+}}%s*{{[Ff]lag ?icon[^}]+}}$') -- after as well
if (matchStrip) then return trim(matchStrip) end
 
matchStrip = value:match('^([^<]-){{[Ff]lag ?icon[^}]+}}$')
if (matchStrip) then return trim(matchStrip) end