Content deleted Content added
simplifying regex and assignment Tag: Reverted |
sync with live |
||
Line 238:
local function patternSearchEncode(s)
return mw.ustring.gsub(s, "([%W])", "%%%1")
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, "([%W])", "%%%1")
title_prefix = match_prefix
title_suffix = match_suffix
debugLog(2, "parse successful")
debugLog(3, "title_prefix = [" .. title_prefix .. "]")
|