வார்ப்புரு:Template usage
&lt;!-- Curly brackets matching should ignore [^}], \{{!}}; insource:/\{} is OK.
 --&gt;&lt;onlyinclude&gt;&lt;!--
 Make a search link.
 --&gt;{{plain link
   |url = 
     {{fullurl:Special:Search|search=&lt;!--
         --&gt;{{urlencode:&lt;!-- encodes spaces, so let's avoid unecessary spaces.
 
           Build this query:
           hastemplate: template insource:/\{\{ *[Tt]emplate *\| *[^}]*pattern/
 
           Add the ever present &quot;hastemplate:&quot; filter and a space
           --&gt;hastemplate:&quot;{{{template|{{{1|Template usage}}}}}}&quot; &lt;!-- 
 
           Add the &quot;insource:/\{\{ *&quot;
           --&gt;insource:/\{\{ *&lt;!--
 
           Add the &quot;[Tt]&quot;.
           Save from an expensive, /regexp/i.
           --&gt;[{{#invoke:String|sub&lt;!-- saw first [ of a &quot;[Tt]&quot;  --&gt;
           |{{uc:{{{template|{{{1|Template usage}}}}}}}}|1|1}}{{#invoke:String|sub
           |{{lc:{{{template|{{{1|Template usage}}}}}}}}|1|1}}]{{#invoke:String|sub 
           &lt;!--                                               ^
                                                      You saw ]. 
 
           Add &quot;emplate&quot;, the rest of the template name, starting from char 2.--&gt;
           |{{{template|{{{1|Template usage}}}}}}|2}}&lt;!-- 
 
           Add the tricky regexp part.
           --&gt; *\{{!}}[^}]*&lt;!-- optional space &quot; *&quot; around initial pipe 
           initial pipe is \|, i.e. \{{!}}
           Trickiest part: [character class] inverted with ^:  [^any char NOT }] 
           Zero or more (*) of those &quot;non-curly brackets&quot;.
           All this stuff always matches, shows in bold in the search results
 
           Add the users regexp pattern part and closing /.
           --&gt;{{{pattern|{{{2|''regexp''}}}}}}/&lt;!--
 
           Add &quot;prefix:&quot; You see the space before it.
           --&gt; prefix:&lt;!--
           --&gt;{{#switch:&lt;!-- add namespace &quot;numbers and letters&quot; recognition --&gt;
             {{{prefix|{{{3|}}}}}}
             |#default = {{{prefix|{{{3|{{FULLPAGENAME}}}}}}}}
             |n = {{NAMESPACE}}
             |0|: = :
             |1 = {{ns:1}}:
             |2 = {{ns:2}}:
             |3 = {{ns:3}}:
             |4 = {{ns:4}}:
             |5 = {{ns:5}}:
             |6 = {{ns:6}}:
             |7 = {{ns:7}}:
             |8 = {{ns:8}}:
             |9 = {{ns:9}}:
             |10 = {{ns:10}}:
             |11 = {{ns:11}}:
             |12 = {{ns:12}}:
             |13 = {{ns:13}}:
             |14 = {{ns:14}}:
             |15 = {{ns:15}}:
             |100 = {{ns:100}}:
             |101 = {{ns:101}}:
             |108 = {{ns:108}}:
             |109 = {{ns:109}}:
             |118 = {{ns:118}}:
             |119 = {{ns:119}}:
             |446 = {{ns:446}}:
             |447 = {{ns:447}}:
             |711 = {{ns:711}}:
             |710 = {{ns:710}}:
             |828 = {{ns:828}}:
             |829 = {{ns:829}}:
             |2600 = {{ns:2600}}:
           }}
         }}&lt;!-- End urlencode. --&gt;
       }}&lt;!-- End fullurl
     url done
     Now for name param of plainlinks.
 
   Appearance of link looks just like the query, unless labeled. 
   So we're rebuilding the query just for show this time. --&gt;
   |name = &lt;!-- for commentary see duplicate above --&gt;
     {{#if: 
       {{{label|{{{4|}}}}}}
       |{{{label|{{{4}}}}}}
       |{{#if:
         {{{prefix|{{{3|}}}}}}
 
         |hastemplate:&quot;{{{template|{{{1|Template usage}}}}}}&quot; &lt;!--
         --&gt;insource:/\{\{ *&lt;!--
         --&gt;&amp;#91;{{#invoke:String|sub&lt;!-- saw first [ of a &quot;[Tt]&quot;  --&gt;
           |{{uc:{{{template|{{{1|Template usage}}}}}}}}|1|1}}{{#invoke:String|sub
           |{{lc:{{{template|{{{1|Template usage}}}}}}}}|1|1}}&amp;#93;{{#invoke:String|sub 
           |{{{template|{{{1|Template usage}}}}}}|2}}&lt;!--     ^
         --&gt; *\{{!}}&amp;#91;^}&amp;#93;*&lt;!-- optional space &quot; *&quot; around initial pipe 
         --&gt;{{#invoke:String|replace
           |{{#invoke:String|replace
             |{{{pattern|{{{2|''regexp''}}}}}}&lt;!-- Given pattern
           --&gt;|[|&amp;#91;}}&lt;!-- Replace any/all [ with HTML symbol
         --&gt;|]|&amp;#93;}}/&lt;!-- replace any/all ] with there HTML symbol
         --&gt; prefix:&lt;!--
         --&gt;{{#switch:&lt;!-- add namespace &quot;numbers and letters&quot; recognition --&gt;
           {{{prefix|{{{3|}}}}}}
           |#default = {{{prefix|{{{3|{{FULLPAGENAME}}}}}}}}
           |n = {{NAMESPACE}}
           |0|: = &lt;nowiki /&gt;:
           |1 = {{ns:1}}:
           |2 = {{ns:2}}:
           |3 = {{ns:3}}:
           |4 = {{ns:4}}:
           |5 = {{ns:5}}:
           |6 = {{ns:6}}:
           |7 = {{ns:7}}:
           |8 = {{ns:8}}:
           |9 = {{ns:9}}:
           |10 = {{ns:10}}:
           |11 = {{ns:11}}:
           |12 = {{ns:12}}:
           |13 = {{ns:13}}:
           |14 = {{ns:14}}:
           |15 = {{ns:15}}:
           |100 = {{ns:100}}:
           |101 = {{ns:101}}:
           |108 = {{ns:108}}:
           |109 = {{ns:109}}:
           |118 = {{ns:118}}:
           |119 = {{ns:119}}:
           |446 = {{ns:446}}:
           |447 = {{ns:447}}:
           |711 = {{ns:711}}:
           |710 = {{ns:710}}:
           |828 = {{ns:828}}:
           |829 = {{ns:829}}:
           |2600 = {{ns:2600}}:
         }}
       |{{#invoke:String|replace
           |{{#invoke:String|replace
             |'''Testing''' &lt;kbd&gt;{{{pattern|{{{2}}}}}}&lt;/kbd&gt; '''on this page'''&lt;!--
           --&gt;|[|&amp;#91;}}&lt;!-- Replace any/all [ with HTML symbol
         --&gt;|]|&amp;#93;}}&lt;!-- replace any/all ] with there HTML symbol--&gt;
       }}
    }}
 }}&lt;!-- End of plainlinks