Template:Template usage: Difference between revisions
Appearance
No edit summary |
UNDO "pattern can be unnamed now" |
||
| Line 1: | Line 1: | ||
<!-- Curly brackets matching should ignore [^}], \{{!}} | <!-- Curly brackets matching should ignore [^}], \{{!}}; insource:/\{} is OK. | ||
--><onlyinclude>{{#if: | --><onlyinclude>{{#if: | ||
{{{pattern| | {{{pattern|}}} | ||
| <!-- PATTERN true --> | | <!-- PATTERN true --> | ||
{{#if: | {{#if: | ||
| Line 19: | Line 19: | ||
Now save from an expensive, /regexp/i, case-insensitive search | Now save from an expensive, /regexp/i, case-insensitive search | ||
by outputing [Xx] where x is first letter of template name. --> | by outputing [Xx] where x is first letter of template name. --> | ||
|{{uc:{{{1|{{{template| | |{{uc:{{{1|{{{template|val}}}}}}}}|1|1}}{{#invoke:String|sub | ||
|{{lc:{{{1|{{{template| | |{{lc:{{{1|{{{template|val}}}}}}}}|1|1}}]{{#invoke:String|sub <!-- built [Xx] --> | ||
|{{{1|{{{template| | |{{{1|{{{template|val}}}}}}|2}}\{{!}}<!-- Template name and its pipe: \|, i.e. {{!}} | ||
Trickiest part: [character class] inverted with ^: [^any char NOT }] | Trickiest part: [character class] inverted with ^: [^any char NOT }] | ||
-->[^}]*<!-- Zero or more (*) All this shows in bold in the search results | -->[^}]*<!-- Zero or more (*) All this shows in bold in the search results | ||
-->{{{pattern | -->{{{pattern}}}/<!--User part: last part of regexp, shows in bold too. | ||
You saw the ending / of the /regexp/. | You saw the ending / of the /regexp/. | ||
You see the the space before prefix next: | You see the the space before prefix next: | ||
| Line 60: | Line 60: | ||
For show, appearance of link looks just like the query: --> | For show, appearance of link looks just like the query: --> | ||
| name = {{{ | | name = {{{2|{{{label|{{#invoke:String|replace | ||
|{{#invoke:String|replace | |{{#invoke:String|replace | ||
|hastemplate:"{{{1|{{{template|Template usage}}}}}}"<!-- | |hastemplate:"{{{1|{{{template|Template usage}}}}}}"<!-- | ||
--> insource:<kbd>/\{<!-- | --> insource:<kbd>/\{<!-- | ||
-->[{{#invoke:String|sub | -->[{{#invoke:String|sub | ||
|{{uc:{{{1|{{{template| | |{{uc:{{{1|{{{template|val}}}}}}}}|1|1}}{{#invoke:String|sub | ||
|{{lc:{{{1|{{{template| | |{{lc:{{{1|{{{template|val}}}}}}}}|1|1}}]{{#invoke:String|sub | ||
|{{{1|{{{template| | |{{{1|{{{template|val}}}}}}|2}}\{{!}}<!-- | ||
-->[^}]*<!-- | -->[^}]*<!-- | ||
-->{{{pattern | -->{{{pattern}}}/</kbd><!-- Namespace numbers need upkeep | ||
--> prefix:{{#switch:{{{prefix}}} | --> prefix:{{#switch:{{{prefix}}} | ||
|#default = {{{prefix}}} | |#default = {{{prefix}}} | ||
| Line 106: | Line 106: | ||
hastemplate:"{{{1|{{{template|Template usage}}}}}}" insource:/\{<!-- | hastemplate:"{{{1|{{{template|Template usage}}}}}}" insource:/\{<!-- | ||
-->[{{#invoke:String|sub | -->[{{#invoke:String|sub | ||
|{{uc:{{{1|{{{template| | |{{uc:{{{1|{{{template|val}}}}}}}}|1|1}}{{#invoke:String|sub | ||
|{{lc:{{{1|{{{template| | |{{lc:{{{1|{{{template|val}}}}}}}}|1|1}}]{{#invoke:String|sub | ||
|{{{1|{{{template| | |{{{1|{{{template|val}}}}}}|2}}\{{!}}<!-- | ||
-->[^}]*<!-- | -->[^}]*<!-- | ||
-->{{{pattern | -->{{{pattern}}}/<!-- | ||
--> prefix:{{FULLPAGENAME}} | --> prefix:{{FULLPAGENAME}} | ||
}} | }} | ||
| Line 117: | Line 117: | ||
|{{#invoke:String|replace | |{{#invoke:String|replace | ||
|Test <kbd>/\{[{{#invoke:String|sub | |Test <kbd>/\{[{{#invoke:String|sub | ||
|{{uc:{{{1|{{{template| | |{{uc:{{{1|{{{template|val}}}}}}}}|1|1}}{{#invoke:String|sub | ||
|{{lc:{{{1|{{{template| | |{{lc:{{{1|{{{template|val}}}}}}}}|1|1}}]{{#invoke:String|sub | ||
|{{{1|{{{template| | |{{{1|{{{template|val}}}}}}|2}}\{{!}}<!-- | ||
-->[^}]*<!-- | -->[^}]*<!-- | ||
-->{{{pattern | -->{{{pattern}}}/</kbd>|[|[}}|]|]}} on this page. | ||
}}<!-- end plainlinks #2 --> | }}<!-- end plainlinks #2 --> | ||
}}<!-- end first nested #if:prefix --> | }}<!-- end first nested #if:prefix --> | ||
| Line 163: | Line 163: | ||
}} | }} | ||
| name = | | name = | ||
{{{ | {{{2|{{{label|{{#invoke:String|replace | ||
|{{#invoke:String|replace | |{{#invoke:String|replace | ||
|hastemplate:"{{{1|{{{template|Template usage}}}}}}"<!-- | |hastemplate:"{{{1|{{{template|Template usage}}}}}}"<!-- | ||
| Line 202: | Line 202: | ||
}} | }} | ||
}} | }} | ||
| name = {{{ | | name = {{{2|{{{label|{{#invoke:String|replace | ||
|{{#invoke:String|replace | |{{#invoke:String|replace | ||
|hastemplate:"{{{1|{{{template|Template usage}}}}}}"|[|[}}|]|]}}}}}}}} | |hastemplate:"{{{1|{{{template|Template usage}}}}}}"|[|[}}|]|]}}}}}}}} | ||
Revision as of 02:43, 15 July 2015
File:Test Template Info-Icon - Version (2).svg Template documentation[create] [purge]