Module:Sandbox/Hellknowz/Test: Difference between revisions

Content deleted Content added
whoops
mw.unstring
Line 178:
 
-- Digits
local foundPositionStart, foundPositionEnd, foundMatch = seekString:mw.ustring.find(seekString, '^([0-9]+)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 193:
 
-- Time period - a.m./p.m. (before letters)
foundPositionStart, foundPositionEnd, foundMatch = seekString:mw.ustring.find(seekString, '^%s*([ap]%.?m%.?)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 200:
 
-- Word
foundPositionStart, foundPositionEnd, foundMatch = seekString:mw.ustring.find(seekString, '^([A-Za-z]+)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 207:
 
-- Find the possible month name index
monthIndex = monthIndices[stringmw.ustring.lower(foundMatch)]
if (not monthIndex) then monthIndex = monthShortIndices[stringmw.ustring.lower(foundMatch)] end
 
if (monthIndex) then
Line 222:
 
-- Dash with possible whitespace or Date separator (dash without whitespace)
foundPositionStart, foundPositionEnd, foundMatch = seekString:mw.ustring.find(seekString, '^(%s*[%-–—]%s*)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 233:
end
-- Same by entity code - –
foundPositionStart, foundPositionEnd, foundMatch = seekString:mw.ustring.find(seekString, '^(%s*&[nm]dash;%s*)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 239:
end
-- Time separator (colon without whitespace)
foundPositionStart, foundPositionEnd, foundMatch = seekString:mw.ustring.find(seekString, '^(:)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 246:
 
-- Comma and any following whitespace
foundPositionStart, foundPositionEnd, foundMatch = seekString:mw.ustring.find(seekString, '^(,%s*)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 253:
 
-- Whitespace (after all others that capture whitespace)
foundPositionStart, foundPositionEnd, foundMatch = seekString:mw.ustring.find(seekString, '^(%s+)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location