User:Monkbot/Task 2: CS1 deprecated coauthor parameters
This script is intended to pluck some of the low hanging fruit from Category:Pages containing cite templates with deprecated parameters. Editors often place multiple coauthors in either |coauthor=
or |coauthors=
(these two parameters are aliases of each other so hereafter |coauthor=
) and separate the coauthors with a semicolon with or without a following space. This script replaces |coauthor=
with an appropriate number of |authorn=
parameters beginning with |author2=
.
The script will not do a replacement when:
- the template contains
|ref=harv
.|coauthor=
is not used when Module:Citation/CS1 creates theCITEREF
(used by{{sfn}}
and the{{harv}}
family of templates) but|author2=
,|author3=
, and|author4=
are used. - the template is a
{{citation}}
template because this template automatically sets|ref=harv
. - the template contains
|lastn=
or|authorn=
where n is greater than 1 and when:|lastn=
or|authorn=
contains a value and precedes|coauthor=
– if a stray|author2=
is empty and precedes|coauthor=
the replacement|author2=
value overrides the empty|author2=
; or|lastn=
or|authorn=
with or without an assigned value follows|coauthor=
– a|author2=
that follows the replacement|author2=
will override the replacement
When |coauthor=
in CS1 citations have only one coauthor name, or a list of names separated by semicolons, replace |coauthor=
and subsequent semicolons with |author2=
, |author3=
, etc. When |coauthor=
is empty, remove it from the citation. For example replace:
|coauthor=First Coauthor; Second Coauthor; Third Coauthor
with
|author2=First Coauthor
|author3=Second Coauthor
|author4=Third Coauthor
The rules for one coauthor name and multiple coauthor names are different. For a single name in |coauthor=
:
- must have at least one name component with up to three others allowed (
|coauthor=Bono
,|coauthor=John Philip Sousa
|coauthor=Matakoni, J. L. B.
<name>[<comma><space><name><space><name><space><name>]
- where
<name>
:- any letter, period, apostrophe, or hyphen
- name may be prefixed with
and
or&
:|coauthor=and John Philip Sousa
|coauthor=& Matakoni, J. L. B.
(these prefixes are removed)
For multiple (2–9) names in |coauthor=
each name:
- any letter, period, apostrophe, hyphen, spaces
- all but the last name may be wikilinked (
[[Abraham Lincoln]]
but not[[Abraham Lincoln|Lincoln, Abraham]]
) - the last name in the list may be separated with
; and
or; &
(these prefixes are removed)
The individual authors listed in |coauthor=
must be separated by a semicolon.
|coauthor=
may not end with a semicolon.
The script does not evaluate or validate the content of |coauthor=
.
Known shortcomings
- If an editor separates a coauthor in a list of coauthors with a comma instead of a semicolon, the coauthor following the comma is grouped with the author preceding the comma:
|coauthor=First Coauthor, Second Coauthor; and Third Coauthor
becomes:|author2=First Coauthor, Second Coauthor
|author3=Third Coauthor
To do
Fix single coauthor detection so that it doesn't treat multiple comma-separated coauthors as a single authorDo not do the replacement if the citation contains|ref=harv
because such edits will break existing{{sfn}}
or{{harv}}
linksRemove{{citation}}
from Capture$1
because it automatically sets|ref=harv
Prevent replacement if the citation contains|lastn=
or|authorn=
where n is greater than 1- Handle the case where
|coauthor=
or|coauthors=
precedes|last=
,|last1=
,|author=
, or|author1=
Regex description
The script has four steps. The first looks for citations with |coauthor=
or |coauthors=
and |ref=harv
; these citations are modified to protect the internal linking mechanism between these citations and their associated {{sfn}}
and {{harv}}
references. Similarly, step 3 protects citations that already have |authorn=
or |lastn=
where n is greater than 1. The third step modifies citations with |coauthor=
or |coauthors=
. The fourth step restores the citations modified in steps 1 and 2.
Step 1
Protect citations that contain |ref=harv
and |coauthor=
or |coauthors=
. My thanks to Editor Makyen for this technique.
- Capture
$1
- There are two versions of this capture. One matches when
|ref=harv
occurs in the citation before|coauthor=
and the other when|ref=harv
occurs after. Capture$1
includes everything through theco
of|coauthor=
. (\{\{\s*(?:[Cc]ite ... [^}]*\|\s*ref\s*=\s*harv\s*\|[^}]*\|\s*co)
(the other version is similar)
- Capture
- Capture
$2
- As with capture
$1
, there are two versions of this capture; one with and one without|ref=harv
. Capture$2
includes everything afterco
of|coauthor=
. (authors?\s*=\s*\w[^}]*\}\})
- Capture
- The replacement
- The replacement adds the string
BoGuSNonMaTcHiNgStRiNg1
between captures$1
and$2
. Adding this string protects these citation by preventing step 3 regexes from recognizing|coauthor=
parameters.
Step 2
Similar to step 1, this step protects citations that already have |authorn=
or |lastn=
where n is greater than 1.
- Capture
$1
- Also similar, there are two versions: one that matches
|authorn=
or|lastn=
before|coauthor=
, and one that matches after. Capture$1
includes everything through theco
of|coauthor=
. |authorn=
or|lastn=
precedes|coauthor=
:(\{\{\s*(?:[Cc]ite ... [^}]*\|\s*(?:author|last)(?:[2-9]|\d\d)\s*=\s*[\w\[][^}]*\|\s*co)
|authorn=
or|lastn=
follows|coauthor=
:(\{\{\s*(?:[Cc]ite ... [^}]*\|\s*co)
(?:author|last)(?:[2-9]|\d\d)
– either author or last and 2-9 or 10-99
- Capture
- Capture
$2
|authorn=
or|lastn=
precedes|coauthor=
:(authors?\s*=\s*[\w\[][^}]*\}\})
|authorn=
or|lastn=
follows|coauthor=
:(authors?\s*=\s*[\w\[][^}]*\|\s*(?:author|last)(?:[2-9]|\d\d)\s*=[^}]*\}\})
- Capture
- The replacement
- Same as step 1 replacement.
Step 3
Replace |coauthor=
or |coauthors=
with |author2=author name
though |authorn=author name
where n is < 11.
- Capture
$1
- The several Module:Citation/CS1 based templates that detect deprecated
|coauthor=
;{{cite AV media}}
but not{{cite AV media notes}}
,{{cite news}}
but not{{cite newsgroup}}
. This capture also makes sure that the citation has one of|author=
,|author1=
,|last=
, or|last1=
preceding|coauthor=
and that these parameters have an assigned value of some sort. The regex looks for an initial word character or[
. This ensures that the names in|coauthor=
will be displayed (without one of the|author=
or|last=
,|author2=
–|authorn=
are ignored by Module:Citation/CS1). At this time, citations where the|author=
or|last=
parameters follow|coauthor=
are ignored.(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)
- Capture
- Capture
$2–$(n-1)
(multiple coauthor names) - These captures make up the bulk of the regex. For this script, each coauthor name must be followed by a semicolon (
;
) except for the last coauthor name. ([\w\s\.,'\[\]-]+)
– word characters, spaces, periods, commas, apostrophe (for names like O'Brian), and (presumably) wikilink markup
- Capture
- Capture
$2
(single coauthor name) - This capture may be preceded by the text " and ", " with ", or " & ". The capture is different because the captures used for multiple coauthor names are bounded by the semicolons. Coauthor may be a one-, two-, three-, or four-part name.
\s*(?:and\b|with\b|&)?\s*([\w\.,-]+\s*[\w\.-]*\s*[\w\.-]*\s*[\w\.-]*)
- Capture
- Last coauthor separation
- Quite often, editors separate the last coauthor with "; and " or "; & ". This non-capture accommodates that. The
\b
word boundary prevents this regex from improperly matching "and" in "andrew", etc. (?:\s*and\b|\s*&)?
– when loading this script into AWB from a file, the symbol&
must be written&
- Last coauthor capture
$n
- Same as captures
$3–$(n-1)
except that\b
word boundary prevents the script from adding an empty|authorn=
when|coauthor=
ends with a semicolon. (\s*\b[\w\s\.,'\[\]-]+?)
- Last coauthor capture
- Capture
$(n+1)
- Captures the remainder of the citation. The
[\|\}]
will allow this script to find|coauthor=
anywhere in the template. (\s*[\|\}][^}]*)
- Capture
Step 4
Restore protected citations to their original states.
- Capture
$1
- This capture matches everything up to the added special string
BoGuSNonMaTcHiNgStRiNg1
(\{\{\s*(?:[Cc]ite ... [^}]*))
- Capture
- Capture
$2
- This capture matches everything after the added special string
BoGuSNonMaTcHiNgStRiNg1
([^}]*\}\})
- Capture
- The replacement
The replacement captures $1
and $2
.
Script
<?xml version="1.0"?>
<AutoWikiBrowserPreferences xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:space="preserve" Version="5.5.2.3">
<Project>wikipedia</Project>
<LanguageCode>en</LanguageCode>
<CustomProject />
<Protocol>http://</Protocol>
<LoginDomain />
<List>
<ListSource>Category:Pages containing cite templates with deprecated parameters</ListSource>
<SelectedProvider>CategoryListProvider</SelectedProvider>
<ArticleList />
</List>
<FindAndReplace>
<Enabled>true</Enabled>
<IgnoreSomeText>false</IgnoreSomeText>
<IgnoreMoreText>false</IgnoreMoreText>
<AppendSummary>false</AppendSummary>
<Replacements>
<!--
(1) protect any citations that have |ref=harv because adding |authorn= parameters will cause Module:Citation/CS1 to include the new author(s) in
the CITEREF anchor which will break existing links between {{sfn}} or {{harv}} short form citations. Right now there are two steps to this: citations where
|ref=harv precedes |coauthor(s)= and one where |coauthor(s)= precedes |ref=harv. This might be simplified to just protect any citation that has |ref=harv
whether or not it has |coauthor(s)=.
We protect a citation by inserting the unique string BoGuSNonMaTcHiNgStRiNg1 into the middle of |coauthor(s)=: |coBoGuSNonMaTcHiNgStRiNg1author= so that |coauthor(s)= is
no longer recognizable as |coauthor(s)= which is what all of the remaining rules are looking for.
-->
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*ref\s*=\s*harv\s*\|[^}]*\|\s*co)(authors?\s*=\s*\w[^}]*\}\})</Find>
<Replace>$1BoGuSNonMaTcHiNgStRiNg1$2</Replace>
<Comment>Block edits to cites with |ref=harv occurring before |coauthor</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*co)(authors?\s*=\s*\w[^}]*\|\s*ref\s*=\s*harv[^}]*\}\})</Find>
<Replace>$1BoGuSNonMaTcHiNgStRiNg1$2</Replace>
<Comment>Block edits to cites with |ref=harv occurring after |coauthor</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<!--
(2) protect any citations that have numbered |lastn= or |authorn= parameters where n is greater than 1. I'm not clever enough to figure out
how to get AWB to start anywhere other than |author2=. There are two steps to this: citations where |lastn= or |authorn= precedes |coauthor(s)=
and one where |coauthor(s)= precedes |lastn= or |authorn=. This might be simplified to just protect any citation that has |lastn= or |authorn=
whether or not it has |coauthor(s)=.
-->
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:author|last)(?:[2-9]|\d\d)\s*=\s*\w[^}]*\|\s*co)(authors?\s*=\s*[\w\[][^}]*\}\})</Find>
<Replace>$1BoGuSNonMaTcHiNgStRiNg1$2</Replace>
<Comment>Block edits to cites with |lastn= or |authorn (where n>1) that occur before |coauthor</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*co)(authors?\s*=\s*[\w\[][^}]*\|\s*(?:author|last)(?:[2-9]|\d\d)\s*=[^}]*\}\})</Find>
<Replace>$1BoGuSNonMaTcHiNgStRiNg1$2</Replace>
<Comment>Block edits to cites with |lastn= or |authorn (where n>1) occurring after |coauthor</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<!--
The more-than-one-coauthor replacement rules (2 to 9 coauthors).
These rules do not fix the |coauthor= without |author= violation. For these rule, |last(1)= or |author(1)= or |authors= must precede |coauthor(s)=. Another
set of rules will be required to handle the case where |last(1)= or |author(1)= or |authors= are preceded by |coauthor(s)=. This limitation was adopted
as a first step in getting the script approved for use by Monkbot.
Each name in |coauthor(s)= must be separated from the preceding name by an optional space, a required semicolon, and
an optional space. The last name in the list may be separated from the rest of the list by an optional space, a required semicolon, an optional space
followed by one of two optional 'and' or '&', and an optional space.
-->
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=\s*([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);(?:\s*and\b|\s*&)?(\s*\b[\w\s\.,'-]+?)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2|author3=$3|author4=$4|author5=$5|author6=$6|author7=$7|author8=$8|author9=$9|author10=$10$11</Replace>
<Comment>author2; author3; author4; author5; author6; author7; author8; author9;[ &| and] author10</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=\s*([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);(?:\s*and\b|\s*&)?(\s*\b[\w\s\.,'-]+?)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2|author3=$3|author4=$4|author5=$5|author6=$6|author7=$7|author8=$8|author9=$9$10</Replace>
<Comment>author2; author3; author4; author5; author6; author7; author8;[ &| and] author9</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=\s*([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);(?:\s*and\b|\s*&)?(\s*\b[\w\s\.,'-]+?)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2|author3=$3|author4=$4|author5=$5|author6=$6|author7=$7|author8=$8$9</Replace>
<Comment>author2; author3; author4; author5; author6; author7;[ &| and] author8</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=\s*([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);\s?([\w\s\.,'\[\]-]+?);(?:\s*and\b|\s*&)?(\s*\b[\w\s\.,'-]+?)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2|author3=$3|author4=$4|author5=$5|author6=$6|author7=$7$8</Replace>
<Comment>author2; author3; author4; author5; author6;[ &| and] author7</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=\s*([\w\s\.,'\[\]-]+?);([\w\s\.,'\[\]-]+?);([\w\s\.,'\[\]-]+?);([\w\s\.,'\[\]-]+?);(?:\s*and\b|\s*&)?(\s*\b[\w\s\.,'-]+?)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2|author3=$3|author4=$4|author5=$5|author6=$6$7</Replace>
<Comment>author2; author3; author4; author5;[ &| and] author6</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=([\w\s\.,'\[\]-]+?);([\w\s\.,'\[\]-]+?);([\w\s\.,'\[\]-]+?);(?:\s*and\b|\s*&)?(\s*\b[\w\s\.,'-]+?)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2|author3=$3|author4=$4|author5=$5$6</Replace>
<Comment>author2 author3 author4[;|&|; and] author5</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=([\w\s\.,'\[\]-]+?);([\w\s\.,'\[\]-]+?);(?:\s*and\b|\s*&)?(\s*\b[\w\s\.,'-]+?)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2|author3=$3|author4=$4$5</Replace>
<Comment>author2 author3[;|&|; and] author4</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=([\w\s\.,'\[\]-]+?);(?:\s*and\b|\s*&)?(\s*\b[\w\s\.,'-]+?)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2|author3=$3$4</Replace>
<Comment>author2[;|&|; and] author3</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<!--
The one coauthor rule. Different from the other rules, this rule expects the name to be composed of up to four parts. The first part may be separated
from the others by an optional comma. All parts may contain letters, hyphens or periods. Optionally, the collective name may be preceded by one of these:
'and', 'with', or '&'.
-->
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*\|\s*(?:authors?|last)1?\s*=\s*[\w\[][^}]*)\|\s*coauthors?\s*=\s*(?:and\b|with\b|&)?\s*([\w\.,-]+\s*[\w\.-]*\s*[\w\.-]*\s*[\w\.-]*)(\s*[\|\}][^}]*)</Find>
<Replace>$1|author2=$2$3</Replace>
<Comment>author2</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<!--
If |coauthor(s)= is empty, remove it. Don't know if I should make separate rules for |coauthor= and |coauthors=.
-->
<Replacement>
<Find>(\{\{\s*(?:[Cc]ite (?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)|[Cc]itation[^}]+\s*)[^}]*?)\|\s*coauthors?\s*=\s*([\|\}][^}]*)</Find>
<Replace>$1$2</Replace>
<Comment>Empty</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
<!--
This is the last step. Once all of the other rules have run, if we protected any citations by adding BoGuSNonMaTcHiNgStRiNg1 to them, search for and
replace that string with nothing.
-->
<Replacement>
<Find>(\{\{\s*[Cc]ite\s*(?:(?:AV media(?! notes))|book|conference|encyclopedia|journal|(?:news(?!group|paper))|press release|sign|techreport|thesis|web)[^}]*)BoGuSNonMaTcHiNgStRiNg1([^}]*\}\})</Find>
<Replace>$1$2</Replace>
<Comment>Restore protected cites</Comment>
<IsRegex>true</IsRegex>
<Enabled>true</Enabled>
<Minor>false</Minor>
<BeforeOrAfter>false</BeforeOrAfter>
<RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
</Replacement>
</Replacements>
<AdvancedReps />
<SubstTemplates />
<IncludeComments>false</IncludeComments>
<ExpandRecursively>true</ExpandRecursively>
<IgnoreUnformatted>false</IgnoreUnformatted>
</FindAndReplace>
<Editprefs>
<GeneralFixes>false</GeneralFixes>
<Tagger>false</Tagger>
<Unicodify>false</Unicodify>
<Recategorisation>0</Recategorisation>
<NewCategory />
<NewCategory2 />
<ReImage>0</ReImage>
<ImageFind />
<Replace />
<SkipIfNoCatChange>false</SkipIfNoCatChange>
<RemoveSortKey>false</RemoveSortKey>
<SkipIfNoImgChange>false</SkipIfNoImgChange>
<AppendText>false</AppendText>
<AppendTextMetaDataSort>false</AppendTextMetaDataSort>
<Append>true</Append>
<Text />
<Newlines>2</Newlines>
<AutoDelay>5</AutoDelay>
<BotMaxEdits>500</BotMaxEdits>
<SupressTag>true</SupressTag>
<RegexTypoFix>false</RegexTypoFix>
</Editprefs>
<General>
<AutoSaveEdit>
<Enabled>false</Enabled>
<SavePeriod>30</SavePeriod>
<SaveFile />
</AutoSaveEdit>
<SelectedSummary>Fix [[Help:CS1_errors#deprecated_params|CS1 deprecated coauthor parameter errors]]</SelectedSummary>
<Summaries>
<string>clean up</string>
<string>re-categorisation per [[WP:CFD|CFD]]</string>
<string>clean up and re-categorisation per [[WP:CFD|CFD]]</string>
<string>removing category per [[WP:CFD|CFD]]</string>
<string>[[Wikipedia:Template substitution|subst:'ing]]</string>
<string>[[Wikipedia:WikiProject Stub sorting|stub sorting]]</string>
<string>[[WP:AWB/T|Typo fixing]]</string>
<string>bad link repair</string>
<string>Fixing [[Wikipedia:Disambiguation pages with links|links to disambiguation pages]]</string>
<string>Unicodifying</string>
<string>Fix [[Help:CS1_errors#deprecated_params|CS1 deprecated coauthor parameter errors]]</string>
</Summaries>
<PasteMore>
<string />
<string />
<string />
<string />
<string />
<string />
<string />
<string />
<string />
<string />
</PasteMore>
<FindText>\|\s*ref\s*=\s*harv</FindText>
<FindRegex>true</FindRegex>
<FindCaseSensitive>false</FindCaseSensitive>
<WordWrap>true</WordWrap>
<ToolBarEnabled>false</ToolBarEnabled>
<BypassRedirect>true</BypassRedirect>
<AutoSaveSettings>false</AutoSaveSettings>
<noSectionEditSummary>false</noSectionEditSummary>
<restrictDefaultsortAddition>true</restrictDefaultsortAddition>
<restrictOrphanTagging>true</restrictOrphanTagging>
<noMOSComplianceFixes>false</noMOSComplianceFixes>
<syntaxHighlightEditBox>false</syntaxHighlightEditBox>
<highlightAllFind>false</highlightAllFind>
<PreParseMode>false</PreParseMode>
<NoAutoChanges>false</NoAutoChanges>
<OnLoadAction>0</OnLoadAction>
<DiffInBotMode>false</DiffInBotMode>
<Minor>true</Minor>
<AddToWatchlist>2</AddToWatchlist>
<TimerEnabled>false</TimerEnabled>
<SortListAlphabetically>false</SortListAlphabetically>
<AddIgnoredToLog>false</AddIgnoredToLog>
<EditToolbarEnabled>true</EditToolbarEnabled>
<filterNonMainSpace>false</filterNonMainSpace>
<AutoFilterDuplicates>false</AutoFilterDuplicates>
<FocusAtEndOfEditBox>false</FocusAtEndOfEditBox>
<scrollToUnbalancedBrackets>false</scrollToUnbalancedBrackets>
<TextBoxSize>10</TextBoxSize>
<TextBoxFont>Courier New</TextBoxFont>
<LowThreadPriority>false</LowThreadPriority>
<Beep>false</Beep>
<Flash>false</Flash>
<Minimize>false</Minimize>
<LockSummary>false</LockSummary>
<SaveArticleList>true</SaveArticleList>
<SuppressUsingAWB>false</SuppressUsingAWB>
<AddUsingAWBToActionSummaries>false</AddUsingAWBToActionSummaries>
<IgnoreNoBots>false</IgnoreNoBots>
<ClearPageListOnProjectChange>false</ClearPageListOnProjectChange>
<SortInterWikiOrder>true</SortInterWikiOrder>
<ReplaceReferenceTags>true</ReplaceReferenceTags>
<LoggingEnabled>true</LoggingEnabled>
<AlertPreferences />
</General>
<SkipOptions>
<SkipNonexistent>true</SkipNonexistent>
<Skipexistent>false</Skipexistent>
<SkipWhenNoChanges>false</SkipWhenNoChanges>
<SkipSpamFilterBlocked>true</SkipSpamFilterBlocked>
<SkipInuse>true</SkipInuse>
<SkipWhenOnlyWhitespaceChanged>false</SkipWhenOnlyWhitespaceChanged>
<SkipOnlyGeneralFixChanges>true</SkipOnlyGeneralFixChanges>
<SkipOnlyMinorGeneralFixChanges>false</SkipOnlyMinorGeneralFixChanges>
<SkipOnlyCasingChanged>false</SkipOnlyCasingChanged>
<SkipIfRedirect>false</SkipIfRedirect>
<SkipIfNoAlerts>false</SkipIfNoAlerts>
<SkipDoes>false</SkipDoes>
<SkipDoesNot>false</SkipDoesNot>
<SkipDoesText />
<SkipDoesNotText />
<Regex>false</Regex>
<CaseSensitive>false</CaseSensitive>
<AfterProcessing>false</AfterProcessing>
<SkipNoFindAndReplace>true</SkipNoFindAndReplace>
<SkipMinorFindAndReplace>false</SkipMinorFindAndReplace>
<SkipNoRegexTypoFix>false</SkipNoRegexTypoFix>
<SkipNoDisambiguation>false</SkipNoDisambiguation>
<SkipNoLinksOnPage>false</SkipNoLinksOnPage>
<GeneralSkipList />
</SkipOptions>
<Module>
<Enabled>false</Enabled>
<Language>C# 2.0</Language>
<Code> public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
Skip = false;
Summary = "test";
ArticleText = "test \r\n\r\n" + ArticleText;
return ArticleText;
}</Code>
</Module>
<ExternalProgram>
<Enabled>false</Enabled>
<Skip>false</Skip>
<Program />
<Parameters />
<PassAsFile>true</PassAsFile>
<OutputFile />
</ExternalProgram>
<Disambiguation>
<Enabled>false</Enabled>
<Link />
<Variants />
<ContextChars>20</ContextChars>
</Disambiguation>
<Special>
<namespaceValues>
<int>0</int>
</namespaceValues>
<remDupes>true</remDupes>
<sortAZ>true</sortAZ>
<filterTitlesThatContain>false</filterTitlesThatContain>
<filterTitlesThatContainText />
<filterTitlesThatDontContain>false</filterTitlesThatDontContain>
<filterTitlesThatDontContainText />
<areRegex>false</areRegex>
<opType>0</opType>
<remove />
</Special>
<Tool>
<ListComparerUseCurrentArticleList>0</ListComparerUseCurrentArticleList>
<ListSplitterUseCurrentArticleList>0</ListSplitterUseCurrentArticleList>
<DatabaseScannerUseCurrentArticleList>0</DatabaseScannerUseCurrentArticleList>
</Tool>
<Plugin />
</AutoWikiBrowserPreferences>