User:Who R you?/sandbox11/doc

Returns best standardized name linked to best possible existing article for an Ontario provincial by−election based on Year, Month, and By-Election Riding.

Usage
  where some or all of the unnamed parameters are specified and indicate, in sequence:

Note: When naming articles, etc, ridings names with more than one town/region/etc name are expected to be separated by a "&mdash;" (115%) and hyphenated names are expected to be separated by standard keyboard hyphen "-". The term "by-election" is typically expected to appear uncapitalized (unless it begins a sentence/title/etc in which case the "B" is expected to be capitalized as in "By-election"), and titles with the term "by-election" are expected to contain the standard keyboard hyphen "-". (e.g. Ontario provincial by-election, Haliburton—Kawartha Lakes—Brock, Nov1867). Ontario has no single towns/regions/etc which are hyphenated, but federal riding names, such as "Saint-Léonard—Saint-Michel", are expected to use the appropriate mix of standard keyboard hyphen "-" and the em-dash "&mdash;".

Existing article names are searched for in the following order and the first match is returned:
 * Ontario provincial by-election,   By-Election Riding  ,  MthYear
 * Ontario provincial by-election s,  By-Election Riding  ,  MthYear       (&thinsp;Note the added "s"&thinsp;)
 * Ontario provincial by-election,   By-Election Riding  ,  Year
 * Ontario provincial by-elections,   By-Election Riding  ,  Year
 * Ontario provincial by-election,   By-Election Riding
 * Ontario provincial by-elections,   By-Election Riding
 * Ontario provincial by-election,   MthYear
 * Ontario provincial by-elections,   MthYear
 * Ontario provincial by-election,   Year
 * Ontario provincial by-elections,   Year

Example
  would search for: and, finding no matches for any of these, would return the (unlinked) text: ''' Ontario provincial by-election, Ajax&mdash;Pickering, May1863
 * 1) Ontario provincial by-election, Ajax&mdash;Pickering, May1863
 * 2) Ontario provincial by-elections, Ajax&mdash;Pickering, May1863
 * 3) Ontario provincial by-election, Ajax&mdash;Pickering, 1863
 * 4) Ontario provincial by-elections, Ajax&mdash;Pickering, 1863
 * 5) Ontario provincial by-election, Ajax&mdash;Pickering
 * 6) Ontario provincial by-elections, Ajax&mdash;Pickering
 * 7) Ontario provincial by-election, May1863
 * 8) Ontario provincial by-elections, May1863
 * 9) Ontario provincial by-election, 1863
 * 10) Ontario provincial by-elections, 1863