User:Monkbot/Task 4: CS1 deprecated coauthor parameters

Monkbot task 4 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 4 operates on CS1 citations that have |coauthor= parameters that are lists of comma separated names where the names are in last-name-first order.

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

Because the script cannot discriminate between name lists that are Last, First, Last, First, Last, First and Last, Last, Last, Last, Last, Last, it requires that the first name in the list have the form:
 * Last, First Middle
 * Last, First Middle Middle
 * Last, F
 * where:
 * First is a name and least one Middle is required; Middle may be a name or an initial
 * F is an upper case initial which may be followed by an optional period.

It is presumed that if the first name in the list is in this form, the rest of the names in the list are not just a collection of last names.

The last name in a multiname coauthor list may be et al. or may contain et al. when a name is Last, First et al.

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

Task 4 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 4 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  where 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

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>