Content deleted Content added
Create sandbox version of Module:CanadaByProvinceCatNav |
simplifying regex and assignment Tag: Reverted |
||
Line 238:
local function patternSearchEncode(s)
return mw.ustring.gsub(s, "
end
Line 279:
debugLog(4, "match at start, followed by separator? ")
if mw.ustring.match(pn, "^" .. testProvinceEncoded .. "
debugLog(nil, "Yes")
return testProvince
Line 286:
debugLog(4, "match at end, preceded by separator? ")
if mw.ustring.match(pn, "
debugLog(nil, "Yes")
return testProvince
Line 293:
debugLog(4, "match anywhere, preceded and followed by separator? ")
if mw.ustring.match(pn, "
debugLog(nil, "Yes")
return testProvince
Line 311:
local testProvinceStrippedEncoded = patternSearchEncode(testProvinceStripped)
debugLog(4, "test pattern without leading definite article, i.e. '" .. testProvinceStrippedEncoded .. "' ? ")
if (mw.ustring.match(pn, "
or (mw.ustring.match(pn, "^" .. testProvinceStrippedEncoded .. "
or (mw.ustring.match(pn, "
or (mw.ustring.match(pn, "^" .. testProvinceStrippedEncoded .. "$") ~= nil) then
debugLog(nil, "Yes")
Line 337:
debugLog(2, "split pagename around [" .. validprovinceName .. "]")
local validProvinceEncoded = mw.ustring.gsub(validprovinceName, "
debugLog(2, "parse successful")
debugLog(3, "title_prefix = [" .. title_prefix .. "]")
|