Template:Clean URL: Difference between revisions
Robertbaxter (talk | contribs) No edit summary Tag: Manual revert |
Robertbaxter (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{#switch:{{{format|}}} | <!-- This should probably become a Lua module at some point, the #if chaining is going to get cumbersome if too many more patterns are added --><includeonly>{{#switch:{{{format|}}} | ||
|instagram=[{{{1|}}} @{{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(?:instagram.com\/)(.+?)\/?$/|\1}}] | |instagram=[{{{1|}}} @{{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(?:instagram.com\/)(.+?)\/?$/|\1}}] | ||
|#default=[{{{1|}}} {{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(.+?)\/?$/|\1}}] | |#default=[{{{1|}}} {{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(.+?)\/?$/|\1}}] | ||
}}</includeonly> | }} | ||
{{#ifexpr:{{#invoke:String|find|{{lc:{{{1|}}}}}|instagram.com}}>0 | |||
|[{{{1|}}} @{{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(?:instagram.com\/)(.+?)\/?$/|\1}}] | |||
|{{#ifexpr:{{#invoke:String|find|{{lc:{{{1|}}}}}|web.archive.org}}>0 | |||
|[{{{1|}}} \[archived\]] | |||
|[{{{1|}}} {{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(.+?)\/?$/|\1}}] | |||
}} | |||
}} | |||
{{#invoke:String|find|{{lc:{{{1|}}}}}|archive.org}} | |||
</includeonly> |