User:Monkbot/Task 3: CS1 deprecated coauthor parameters

Monkbot task 3 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 3 operates on CS1 citations that have coauthor parameters that are lists of names that roughly follow the Vancouver system.

In general, author lists in Vancouver system citations have the form: Last FM, Last FM, etc. where Last is the author's last name and where F and M are the author's first and middle initials. Task 3 supports author names with 1–3 initials which must be upper case. Author names are separated by. The last name in the coauthor list may be separated from the other names with. Task 3 recognizes this form and the corrupted forms: Last F M, Last F. M., Last F.M. along with other space/period/initial variants.

The last name in a multiname coauthor parameter may be et al.

When coauthor has only a single name, the Vancouver system restrictions do not apply. Uses the same rule as task 2.

Task 3 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 3 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

To do list

 * 1) Task 3 does not recognize Last FM, Last FM, et al. because et al. doesn't match Vancouver system author name format.

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>