Module:Sandbox/Hellknowz/Test: Difference between revisions

Content deleted Content added
add m d - d y
add hyphens and stuff
Line 193:
 
-- Time period - a.m./p.m. (before letters)
local foundPositionStart, foundPositionEnd, foundMatch = seekString:find('^%s*([ap]%.?m%.?)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 200:
 
-- Word
local foundPositionStart, foundPositionEnd, foundMatch = seekString:find('^([A-Za-z]+)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 222:
 
-- Dash with possible whitespace or Date separator (dash without whitespace)
local foundPositionStart, foundPositionEnd, foundMatch = seekString:find('^(%s*%[-–—]%s*)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
if (#foundMatch == 1'-') then -- nothing else is date separator, no hyphens no stuff like that
return ELEMENT_DATESEPARATOR, foundMatch, (currentPosition > #seekString)
else
Line 232:
end
end
-- Same by entity code - –
 
foundPositionStart, foundPositionEnd, foundMatch = seekString:find('^(%s*%&[nm]dash;%s*)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
return ELEMENT_DASH, foundMatch, (currentPosition > #seekString)
end
-- Time separator (colon without whitespace)
local foundPositionStart, foundPositionEnd, foundMatch = seekString:find('^(:)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 241 ⟶ 246:
 
-- Comma and any following whitespace
local foundPositionStart, foundPositionEnd, foundMatch = seekString:find('^(,%s*)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
Line 248 ⟶ 253:
 
-- Whitespace (after all others that capture whitespace)
local foundPositionStart, foundPositionEnd, foundMatch = seekString:find('^(%s+)', currentPosition)
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location