வார்ப்புரு:Regex
&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.
           Add the &quot;insource:&quot; and its regex /slash delimiters/ 
           --&gt;insource:/{{{pattern|{{{1|''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|{{{2|}}}}}}
             |#default = {{{prefix|{{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. --&gt;
   |name = 
     {{#if: 
       {{{label|{{{3|}}}}}}
       |{{{label|{{{3}}}}}}
       |insource:/&lt;!-- rebuilding the query for show this time
       You saw the &quot;insource:&quot; ouput.
 
       Plainlink's name can't have [[ or ], else it breaks the display.
       --&gt;{{#invoke:String|replace
         |{{#invoke:String|replace
           |{{{pattern|{{{1|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
       You saw the / added at the end of insource:/regex/
 
     And now for the prefix part of the name plainlinks needs.
     You see the space before the &quot;prefix:&quot; output.
     --&gt; prefix:&lt;!--
       --&gt;{{#switch:
         {{{prefix|{{{2|}}}}}}
         |#default = {{{prefix|{{FULLPAGENAME}}}}}
         |n = {{NAMESPACE}}
         |0|: = &amp;#58;   &lt;!-- html-symbol escape the : from the template rendering--&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}}:
       }}
     }}&lt;!-- end #if: {{{label}}} or {{{3}}}
   name done --&gt;
 }}&lt;!-- End of plainlinks