Module:Redirect: Difference between revisions

m
1 revision imported from templatewiki:Module:Redirect
m (1 revision imported: Basic templates)
 
m (1 revision imported from templatewiki:Module:Redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 17:
-- redirect.
function p.getTargetFromText(text)
returnlocal target = string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
Line 24:
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
return target and mw.uri.decode(target, 'PATH')
end