Template:Title disambig text

From WikiAlpha
Jump to: navigation, search
The below content is licensed according to Creative Commons Attribution-ShareAlike License contrary to the public domain logo at the foot of the page. It originally appeared on http://en.wikipedia.org. The original article might still be accessible here. You may be able to find a list of the article's previous contributors on the talk page.
{{#invoke:String|match|{{{1}}}|%s%((.-)%)||-1|ignore_errors=true}}
[edit] [purge] Template documentation

Usage

{{Title disambig text|Title (disambig)}}

If page title is of the form Title (disambig), this function will return disambig. If no parenthetical expression is present, returns an empty string.

Write this to use the current page as title:

{{Title disambig text|{{PAGENAME}}}}

Examples

  • {{Title disambig text|Title (whatever)}} → {{#invoke:String|match|Title (whatever)|%s%((.-)%)||-1|ignore_errors=true}}
  • {{Title disambig text|[[Title (whatever)]]}} → {{#invoke:String|match|Title (whatever)|%s%((.-)%)||-1|ignore_errors=true}}

See also

Template:String-handling templates