User:Monkbot/Task 5: CS1 deprecated coauthor parameters

Monkbot task 5 is a variant of the task 2 script. Like task 2, it is intended to pluck some of the low hanging fruit from.

This script replaces the deprecated parameters coauthor and coauthors (hereafter coauthor) with individual authorn parameters where n is a number 2–10. Task 5 operates on CS1 citations that have |coauthor= parameters that are lists of comma separated names where the names are in first-middle-last order.

Generally names in the coauthor parameter must have this form:
 * First Middle Middle Last
 * where First and Middle may be initials and may be followed by a period and where Middle is optional

The script has a one-way overlap with task 3. Task 5 can fix coauthor parameters where the list of names is comma separated Vancouver style. Task 5 cannot fix Vancouver style names where Last is hyphenated or contains an apostrophe, nor when the last initial is followed by a period (Last FM.). Task 3 cannot fix First-Middle-Last form names.

All or part of the last name in a multiname coauthor list may be et al (without terminal period), for example: First Last et al (a terminal period will not match because last names aren't typically terminated with a period).

When coauthor has only a single name, the script uses the same rule as task 2.

Task 5 will not change citations:
 * that have harv, which includes all templates because  sets harv by default
 * where coauthor precedes last, last1, author, or author1
 * that contain lastn or authorn where n is greater than 1

Beyond the exceptions noted in §Ancillary tasks, task 5 does not evaluate, modify, or remove parameter values.

Ancillary tasks
This script also:
 * 1) adds 9 when replacement results in nine authors,
 * 2) removes Wikimarkup italics from  wherever this text occurs in CS1 citations because the wikimarkup contaminates the citation's COinS metadata and because et al. is properly not italicized (see Help:CS1; and cf., viz., & et al. at MOS:ABBR)
 * 3) removes empty coauthor parameters

To do list

 * 1) Remove terminal punctuation from coauthor list of names. Also from author and authors.

Script
  false false   true    false  <Variants /> <ContextChars>20</ContextChars> </Disambiguation> <Special> <namespaceValues> 0    </namespaceValues> <remDupes>true</remDupes> <sortAZ>true</sortAZ> <filterTitlesThatContain>false</filterTitlesThatContain> <filterTitlesThatContainText /> <filterTitlesThatDontContain>false</filterTitlesThatDontContain> <filterTitlesThatDontContainText /> <areRegex>false</areRegex> <opType>0</opType> </Special> <Tool> <ListComparerUseCurrentArticleList>0</ListComparerUseCurrentArticleList> <ListSplitterUseCurrentArticleList>0</ListSplitterUseCurrentArticleList>