Template:Clean URL: Difference between revisions

From stencil.wiki
No edit summary
No edit summary
Line 1: Line 1:
<!-- 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|}}}
<!-- 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><!--
|instagram=[{{{1|}}} @{{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(?:instagram.com\/)(.+?)\/?$/|\1}}]
-->{{#ifexpr:{{#invoke:String|find|{{lc:{{{1|}}}}}|instagram.com}}>0
|#default=[{{{1|}}} {{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(.+?)\/?$/|\1}}]
}}
 
{{#ifexpr:{{#invoke:String|find|{{lc:{{{1|}}}}}|instagram.com}}>0
|[{{{1|}}} @{{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(?:instagram.com\/)(.+?)\/?$/|\1}}]
|[{{{1|}}} @{{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(?:instagram.com\/)(.+?)\/?$/|\1}}]
|{{#ifexpr:{{#invoke:String|find|{{lc:{{{1|}}}}}|web.archive.org}}>0
|{{#ifexpr:{{#invoke:String|find|{{lc:{{{1|}}}}}|web.archive.org}}>0
Line 10: Line 6:
   |[{{{1|}}} {{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(.+?)\/?$/|\1}}]
   |[{{{1|}}} {{#rmatch:{{{1|}}}|/^(?:https?:\/\/)?(?:www\.)?(.+?)\/?$/|\1}}]
   }}
   }}
}}
}}</includeonly>
 
 
{{#invoke:String|find|{{lc:{{{1|}}}}}|archive.org}}
 
 
</includeonly>

Revision as of 17:27, 17 December 2024