Module:Redirect: Difference between revisions
Content added Content deleted
Enwikipedia>SiBr4 (Moved from sandbox: making the isRedirect function available from other modules, like the main function is) |
Enwikipedia>Jackmcbarn (handle redirects that pipe their link) |
||
Line 19: | Line 19: | ||
return string.match( |
return string.match( |
||
text, |
text, |
||
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]]-)%]%]" |
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]" |
||
) or string.match( |
|||
text, |
|||
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]" |
|||
) |
) |
||
end |
end |