Jump to content

英文维基 | 中文维基 | 日文维基 | 草榴社区

User:Dawnseeker2000/DMY module II

From Wikipedia, the free encyclopedia
WikiFunctions.Parse.HideText ht = new WikiFunctions.Parse.HideText(true, false, true);
        public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "";
ArticleText = ht.Hide(ArticleText);
 ////User:Ohconfucius/AWB modules/dmy
 // www. and http
ArticleText=Regex.Replace(ArticleText, @"(\|\s?(?:author(?:link\d?|)|author|chapter|first||journal|last||magazine|newspaper|publisher|title||website|work|via)\s*\=\s*)(?:w{3}\.)(?=\w)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?(?:author(?:link\d?|)|chapter|journal|magazine|newspaper|publisher|title|work|via)\s*\=\s*)https?:\/{2}(?:w{3}\.|)(?=\w)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?(?:author(?:link\d?|)|chapter|journal|magazine|newspaper|publisher|title|work|via)\s*\=\s*)(?:w{3}\.)(?=\w)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?(?:author(?:link\d?|)|chapter|journal|magazine|newspaper|publisher|title|work|via)\s*\=\s*)(\w+(?:\.(?:com?|net|org|gov|\w{2}))(?:\.\w{2}|))(?:\/[^|}]*|)(?=\s*[\]|}])", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(>{{cit[^}]+\|\s?website\s*\=\s*)https?:\/{2}(?:w{3}\.|)(?=\w)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(>{{cit[^}]+\|\s?website\s*\=\s*)(?:w{3}\.)(?=\w)", "$1");
 // rem misplaced punctuation
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>[^<]+?[\]\.\},;–]\s*\'\'[\w-]*(?: [\w-]*){0,3})(\.com|)([;,\.])(\'\')([^<]*?<\/ref>)", "$1$2$4$3$5"); //25189
 //rem superscripted ordinals
ArticleText=Regex.Replace(ArticleText, @"(?i)(\d)<sup>(th|st|nd|rd)<\/sup>", "$1$2");
 //zap redundant {{date}}, {{accessdate}} {{retrieved}} and {{#dateformat}}
ArticleText=Regex.Replace(ArticleText, @"(?i)\{\{date\|((?:19|20)\d{2-[01]\d-[0-3]\d)[ ]*\}\}", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\{\{date\|([0-3]\d[\-\s]\w+|\w+[\-\s][0-3]\d)[ ]*\}\}", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\{\{date\|([^\{\}\|\-]+)(?:\|l?(?:[dmy]{3}|iso|none|link))?\}\}", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\{\{accessdate\|((?:19|20)\d{2-[01]\d-[0-3]\d)[ ]*\}\}", "Retrieved $1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\{\{retrieved[ ]*\|[ ]accessdate=([\-\w, ]*)\}\}", "Retrieved $1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\{\{#dateformat:([^\{\}\|]+)(?:\|dmy|\|mdy)?\}\}", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date[ ]*[^\=][ ]*|\w{2,}[ ]*)\{\{(?:start|end).date[^|}]*\|((?:1[789]|20)\d{2})\}\}", "$1$2");
 //stripping start/end template
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[([12]?\d|30|31)(?:th|st|nd|rd|)(?:_|&nbsp;)(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)", "[[$1 $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)(?:_|&nbsp;)([12]?\d|30|31)(?:th|st|nd|rd|)", "[[$1 $2");
 //month+day piped to month+day
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:[12]?\d|30|31)(?:th|st|nd|rd|)\s(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\|(\d{1,2}\s)(?:th|st|nd|rd|)(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\]\]", "[[$1$2]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s(?:[12]?\d|30|31)(?:th|st|nd|rd|)\|(\d{1,2}\s)(?:th|st|nd|rd|)(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\]\]", "[[$1$2]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2}\s(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\|(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)(\s\d{1,2})(?:th|st|nd|rd|)\]\]", "[[$1$2]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s(?:[12]?\d|30|31)(?:th|st|nd|rd|)\|(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)(\s\d{1,2})(?:th|st|nd|rd|)\]\]", "[[$1$2]]");
 //month+day piped to number
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:[12]?\d|30|31)(?:th|st|nd|rd|)\s(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\|(\d{1,4})\]\]", "[[$1]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s(?:[12]?\d|30|31)(?:th|st|nd|rd|)\|(\d{1,4})\]\]", "[[$1]]");
 //part dates
 //remove leading zeros from dts templates
ArticleText=Regex.Replace(ArticleText, @"(?i)({{dts\d?\|[^}]*\|)0([^}]*}})", "$1$2");
 //month+year
 //Identify surprise or 'Easter egg' diversions linking month+years to year articles. Turn them into month+year links to be dealt with below
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4}#[^\|\]]+\|((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{3,4})\]\]", "[[$1]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{3,4})\]\]", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s\d{3,4}\|([^\]]{1,30})\]\]", "$1");
 //removed piped years when in full date
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[\d{1,2}\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\],?\s?\[\[)[^\|\]]{1,32}\|(\d{1,4}\]\])", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}\]\],?\s?\[\[)[^\|\]]{1,32}\|(\d{1,4}\]\])", "$1$2");
 //Identify surprise or 'Easter egg' diversions linking months to year articles.
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4}#[^\|\]]+\|(January|February|March|April|May|June|July|August|September|October|November|December)\]\]", "$1");
 //Month+day_number "March 7th" -> "March 7"
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s(\d?\d)(?:th|st|nd|rd)\]\]", "[[$1 $2]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[((?:Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s\d?\d)\]\](?:th|st|nd|rd)", "[[$1]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(\d?\d)(?:th|st|nd|rd)\s(January|February|March|April|May|June|July|August|September|October|November|December)\]\]", "$1 $2");
 //ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\d?\d)(?:th|st|nd|rd|)&nbsp;(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))(?=\W)", "$1 $2");
 //ArticleText=Regex.Replace(ArticleText, @"(?i)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s*&nbsp;\s*((?:19\d|20[01])\d)(?=\D)", "$1 $2");
 //(month yyyy-month yy)
ArticleText=Regex.Replace(ArticleText, @"(?i)\((Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s(20)([01]\d)\s?[-–]\s?(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([01]\d)\)", "($1 $2$3–$4 $2$5)");
ArticleText=Regex.Replace(ArticleText, @"(?i)\((Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s(19)([3-9]\d)\s?[-–]\s?(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([3-9]\d)\)", "($1 $2$3–$4 $2$5)");
ArticleText=Regex.Replace(ArticleText, @"(?i)\((Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s(19)(9\d)\s?[-–]\s?(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([01]\d)\)", "($1 $2$3–$4 20$5)");
ArticleText=Regex.Replace(ArticleText, @"(?:the\s?|)([1-2]?\d|30|31)(?:th|st|nd|rd|), ([1-2]?\d|30|31)(?:th|st|nd|rd|)(\s(?:and|&|to|or)\s[1-3]?\d)(?:th|st|nd|rd|)(?:\sof\s?)?\s(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))(?=\W)", "$1, $2$3 $4");
ArticleText=Regex.Replace(ArticleText, @"(?:the\s?|)([1-2]?\d|30|31)(?:th|st|nd|rd|)(\s(?:and|&|to|or)\s|[-–])([1-3]?\d)(?:th|st|nd|rd|)(?:\sof\s?)?\s(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))(?=\W)", "$1$2$3 $4");
ArticleText=Regex.Replace(ArticleText, @"(?:the\s?|)([1-2]?\d|30|31)(?:th|st|nd|rd|)(?:\sof\s?)\s(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))(?=[^\|\]\w\d])", "$1 $2");
ArticleText=Regex.Replace(ArticleText, @"(?:the\s?|)([1-2]?\d|30|31)(?:th|st|nd|rd|)(?:\sof\s?)?\s(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))(?=\W)", "$1 $2");
ArticleText=Regex.Replace(ArticleText, @"(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s(?:the\s|)([1-2]?\d|30|31)(?:th|st|nd|rd|),\s(?:the\s|)([1-2]?\d|30|31)(?:th|st|nd|rd|)(\s(?:and|&|to|or)\s)(?:the\s|)([1-2]?\d|30|31)(?:th|st|nd|rd|)(?=[^\]\|\w\d]\D)", "$1 $2, $3$4 $5");
ArticleText=Regex.Replace(ArticleText, @"(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s(?:the\s|)([1-2]?\d|30|31)(?:th|st|nd|rd|)(\s(?:and|&|to|or)\s)(?:the\s|)([1-2]?\d|30|31)(?:th|st|nd|rd|)(?=[^\]\|\w\d]\D)", "$1 $2$3$4");
ArticleText=Regex.Replace(ArticleText, @"(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s(?:the\s|)([1-3]?\d)(?:th|st|nd|rd)(?=[^\]\|\w\d]\D)", "$1 $2");
ArticleText=Regex.Replace(ArticleText, @"(\s*=\s*)((?:19|20)\d\d),?\s+(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s0?([1-2]?\d|3[01])(?=[\s\r\n]*[\|\}])", "$1$4 $3 $2");
ArticleText=Regex.Replace(ArticleText, @"(\s*\()((?:19|20)\d\d),?\s+(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s0?([1-2]?\d|3[01])(?=\))", "$1$4 $3 $2");
 //Month+day_number piped into number. Preferences do not work. They don't work in sequence because digits in the two dates must be adjacent
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d?\d)\]\](\s?\-?\s?)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
 //same again but with ndash or mdash instead of hyphen
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d?\d)\]\](\s?&[nm]dash;\s?)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
 //same again but with slash instead of hyphen
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d?\d)\]\](\/)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d?\d)\]\](\s?\-?\s?)\[\[(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
 //same again but with ndash instead of hyphen
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d?\d)\]\](\s?&[nm]dash;\s?)\[\[(\d{1,2})\]\]", "$1$2$3$4");
 //same again but with slash instead of hyphen
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d?\d)\]\](\/)\[\[(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d)\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\](\s?\-?\s?)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
 //same again but with ndash instead of hyphen
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d)\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\](\s?&[nm]dash;\s?)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
 //same again but with slash instead of hyphen
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d)\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\](\/)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d)\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\](\s?\-?\s?)\[\[(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
 //same again but with ndash instead of hyphen
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d)\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\](\s?&[nm]dash;\s?)\[\[(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
 //same again but with slash instead of hyphen
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d)\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\](\/)\[\[(\d{1,2}(?:th|st|nd|rd))\]\]", "$1$2$3$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2}(?:th|st|nd|rd)\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1");
ArticleText=Regex.Replace(ArticleText, @"\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|((?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{1,2}(?:th|st|nd|rd))\]\]", "$1");
 //month+day piped into month+day or vice versa
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2}(?:th|st|nd|rd)\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\|((?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd))\]\]", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s\d{1,2}(?:th|st|nd|rd)\|(\d{1,2}(?:th|st|nd|rd)\s(?:January|February|March|April|May|June|July|August|September|October|November|December))\]\]", "$1");
 //4 digit years piped into 2
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4}\|(\d{1,2}(?:th|st|nd|rd))\]\]", "$1");
 //full dates with incorrect 'year in'
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s(?:[0-3][\d]|[\d])\]\]),\s\[\[(\d{1,4})\sin\s[^\]]{1,32}\]\]", "$1 $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[(?:[0-3][\d]|[\d])\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\])\s\[\[(\d{1,4})\sin\s[^\]]{1,32}\]\]", "$1 $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[(?:[0-3][\d]|[\d])\s(?:January|February|March|April|May|June|July|August|September|October|November|December)\]\])\s{{(?:avyear|by|fy|ly|scy|sdy)\|(\d{1,4})}}", "$1 [[$2]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\s(?:[0-3][\d]|[\d])\]\]),\s\{\{(?:avyear|by|fy|ly|scy|sdy)\|(\d{1,4})\}\}", "$1 [[$2]]");
 //insert comma to separate date from army unit
ArticleText=Regex.Replace(ArticleText, @"(?i)(January|February|March|April|May|June|July|August|September|October|November|December) (the \d\d*@th (?:Air(?:borne|)|Arm(?:ou?red|y)|Artillery|Battalion|Brigade|Co(?:mpan|)y|Division|Fleet|Group|Infantry|Land|Panzer|Regiment|Squadron|Sqn)\b)", "$1, $2"); //0
 //remove leading zero from linked date
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s0(\d)(?:th|st|nd|rd|)\]\]", "[[$1 $2]]");
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[0(\d)(?:th|st|nd|rd|)\s(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\]\]", "[[$1 $2]]");
 //change deprecated birth and death templates
ArticleText=Regex.Replace(ArticleText, @"(?i)\|mf=ye?s?", "");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{\{(?:Birth|Death|launch|release|start|end|film date|Wayback)[^\}\|]*\|)", "$1df=yes|");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{\{(?:Birth|Death|launch|release|start|end|film date|Wayback)[^\}\|]*\|)df=ye?s?\|([^}]*df=ye?s?)", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{\{(?:start.date|end.date)\|)df=ye?s?\|((?:1[789]|20)\d{2}\}\})", "$1$2");
 // eliminating time of day
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*author[ ]*=[ ]*)(?:posted|published)(?: by| on)[\s:]\s*(?=\w)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate|author)[ ]*=[ ]*)[0-2]?\d:[0-5]\d(?:[ ]|&nbsp;)(?:[ap]m |[ap]\.m\. |)([A-Z]{1,2}T|UTC)[\.,]?[ ]?", "$1");
 // eliminating days of the week
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate|author)[ ]*=[ ]*)(?:(?:Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day,?)\s", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate|author)[ ]*=[ ]*)(?:(?:Mon|Tues?|Wed|Thur?|Fri|Sat|Sun)[\.,]?)\s", "$1");
 // eliminating dates placed in author parameter
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s*author\s*=\s*)@month @day,? @yyyy\s?(?:,? \d?\d:\d\d(?:\s*|&nbsp;)(?:[apAP][mM]\s*|)(?:GMT\s*|UTC\s*|[A-Z]{1,2}[DS]T\s*|)|)\|", "|");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s*author\s*=\s*)@day @month,? @yyyy\s?(?:,? \d?\d:\d\d(?:\s*|&nbsp;)(?:[apAP][mM]\s*|)(?:GMT\s*|UTC\s*|[A-Z]{1,2}[DS]T\s*|)|)\|", "|");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Jan\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 January $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Feb\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 February $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Mar\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 March $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Apr\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 April $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) @Jun\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 June $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) (?:Jly|Jul\.?) ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 July $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Aug\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 August $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Sep. ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 September $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Oct\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 October $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Nov\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 November $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate)[ ]*=[ ]*)([1-9]|[1-2][0-9]|30|31) Dec\.? ([1-2][0-9]{3})(?=\s*[\|\}])", "$1$2 December $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Jan\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 January $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Feb\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 February $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Mar\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 March $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Apr\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 April $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Jun\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 June $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) (?:Jly|Jul\.?) ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 July $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Aug\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 August $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Sep. ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 September $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Oct\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 October $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Nov\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 November $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref[^>]*>(?:[^<]+?[\s\(]|))([1-9]|[1-2][0-9]|30|31) Dec\.? ([1-2][0-9]{3})(?=(?:[^\w\/\-%,<][^<]*?|)<\/ref>)", "$1$2 December $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Jan\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 January $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Feb\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 February $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Mar\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 March $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Apr\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 April $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Jun\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 June $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) (?:Jly|Jul\.?) ([1-2][0-9]{3})(?=\)\W)", "$1$2 July $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Aug\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 August $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Sep\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 September $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Oct\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 October $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Nov\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 November $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)([ ]\()([1-9]|[1-2][0-9]|30|31) Dec\.? ([1-2][0-9]{3})(?=\)\W)", "$1$2 December $3");
 //Slashes
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?1\/([12]\d{3})(?![\w\d-])", "$1 January $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?2\/([12]\d{3})(?![\w\d-])", "$1 February $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?3\/([12]\d{3})(?![\w\d-])", "$1 March $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?4\/([12]\d{3})(?![\w\d-])", "$1 April $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?5\/([12]\d{3})(?![\w\d-])", "$1 May $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?6\/([12]\d{3})(?![\w\d-])", "$1 June $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?7\/([12]\d{3})(?![\w\d-])", "$1 July $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?8\/([12]\d{3})(?![\w\d-])", "$1 August $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?9\/([12]\d{3})(?![\w\d-])", "$1 September $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/10\/([12]\d{3})(?![\w\d-])", "$1 October $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/11\/([12]\d{3})(?![\w\d-])", "$1 November $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/12\/([12]\d{3})(?![\w\d-])", "$1 December $2");
 //2-digit year – UK style
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?1\/([4-9]\d)(?![\w\d-])", "$1 January 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?2\/([4-9]\d)(?![\w\d-])", "$1 February 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?3\/([4-9]\d)(?![\w\d-])", "$1 March 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?4\/([4-9]\d)(?![\w\d-])", "$1 April 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?5\/([4-9]\d)(?![\w\d-])", "$1 May 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?6\/([4-9]\d)(?![\w\d-])", "$1 June 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?7\/([4-9]\d)(?![\w\d-])", "$1 July 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?8\/([4-9]\d)(?![\w\d-])", "$1 August 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?9\/([4-9]\d)(?![\w\d-])", "$1 September 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/10\/([4-9]\d)(?![\w\d-])", "$1 October 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/11\/([4-9]\d)(?![\w\d-])", "$1 November 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/12\/([4-9]\d)(?![\w\d-])", "$1 December 19$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?1\/([01]\d)(?![\w\d-])", "$1 January 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?2\/([01]\d)(?![\w\d-])", "$1 February 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?3\/([01]\d)(?![\w\d-])", "$1 March 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?4\/([01]\d)(?![\w\d-])", "$1 April 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?5\/([01]\d)(?![\w\d-])", "$1 May 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?6\/([01]\d)(?![\w\d-])", "$1 June 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?7\/([01]\d)(?![\w\d-])", "$1 July 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?8\/([01]\d)(?![\w\d-])", "$1 August 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/0?9\/([01]\d)(?![\w\d-])", "$1 September 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/10\/([01]\d)(?![\w\d-])", "$1 October 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/11\/([01]\d)(?![\w\d-])", "$1 November 20$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([^\w-](?:1[3-9]|[2-3]\d))\/12\/([01]\d)(?![\w\d-])", "$1 December 20$2");
 //numerical format with hyphens and dashes (dd-mm-yyyy) to dmy
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]0?1[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 January $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d)[\-–]0?2[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 February $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]0?3[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 March $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]0?4[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 April $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]0?5[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 May $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]0?6[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 June $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]0?7[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 July $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]0?8[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 August $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]0?9[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 September $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]10[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 October $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]11[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 November $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([0-2]?\d|30|31)[\-–]12[\-–]([1-2]\d{3})(?=\s*[\|\}])", "$1$2 December $3");
 //improperly formatted access dates with endashes (yyyy–mm–dd) and/or missing zeros to ISO
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*accessdate[ ]*=[ ]*)([1-2]\d{3})[–—]([0-2]?\d)[–—]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$2-$3-$4"); //ndashes and emdashes
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*accessdate[ ]*=[ ]*)([1-2]\d{3})-(\d)-([0-2]\d|30|31)(?=\s*[\|\}])", "$1$2-0$3-$4"); //ndashes and emdashes
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*accessdate[ ]*=[ ]*)([1-2]\d{3})-([0-1]\d)-(\d)(?=\s*[\|\}])", "$1$2-$3-0$4"); //ndashes and emdashes
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*accessdate[ ]*=[ ]*)([1-2]\d{3})-(\d)-(\d)(?=\s*[\|\}])", "$1$2-0$3-0$4"); //ndashes and emdashes
 //improperly formatted dates with endashes (yyyy–mm–dd) and/or missing zeros to dmy
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?1–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 January $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?2–([0-2]?\d)(?=\s*[\|\}])", "$1$3 February $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?3–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 March $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?4–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 April $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?5–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 May $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?6–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 June $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?7–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 July $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?8–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 August $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–0?9–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 September $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–10–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 October $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–11–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 November $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})–12–([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 December $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?1[\-–]([1-9])(?=\s*[\|\}])", "$1$3 January $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?2[\-–]([1-9])(?=\s*[\|\}])", "$1$3 February $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?3[\-–]([1-9])(?=\s*[\|\}])", "$1$3 March $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?4[\-–]([1-9])(?=\s*[\|\}])", "$1$3 April $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?5[\-–]([1-9])(?=\s*[\|\}])", "$1$3 May $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?6[\-–]([1-9])(?=\s*[\|\}])", "$1$3 June $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?7[\-–]([1-9])(?=\s*[\|\}])", "$1$3 July $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?8[\-–]([1-9])(?=\s*[\|\}])", "$1$3 August $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]0?9[\-–]([1-9])(?=\s*[\|\}])", "$1$3 September $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]10[\-–]([1-9])(?=\s*[\|\}])", "$1$3 October $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]11[\-–]([1-9])(?=\s*[\|\}])", "$1$3 November $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]12[\-–]([1-9])(?=\s*[\|\}])", "$1$3 December $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]1[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 January $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]2[\-–](0?[1-9]|[1-2]\d)(?=\s*[\|\}])", "$1$3 February $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]3[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 March $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]4[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 April $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]5[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 May $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]6[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 June $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]7[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 July $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]8[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 August $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]9[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 September $2");
 //ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]10[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 October $2");
 //ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]11[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 November $2");
 //ArticleText=Regex.Replace(ArticleText, @"(?i)(\s*=\s*)([1-2]\d{3})[\-–]12[\-–]([0-2]?\d|30|31)(?=\s*[\|\}])", "$1$3 December $2");
 //yyyymmdd_to_dmy
 //code to convert ref ISO-dates outside citation templates
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-01-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 January $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-02-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 February $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-03-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 March $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-04-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 April $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-05-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 May $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-06-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 June $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-07-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 July $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-08-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 August $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-09-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 September $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-10-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 October $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-11-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 November $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-12-0(\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 December $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-01-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 January $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-02-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 February $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-03-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 March $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-04-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 April $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-05-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 May $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-06-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 June $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-07-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 July $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-08-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 August $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-09-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 September $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-10-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 October $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-11-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 November $3$5$6");
ArticleText=Regex.Replace(ArticleText, @"(?i)(<ref.*?>[^<]+?)(\s\()([12]\d{3})-12-([1-3]\d)(\)[^\w\/\-%,])([^<]*?<\s?\/ref.*?>)", "$1$2$4 December $3$5$6");
 //convert md-mdy date ranges to dm-dmy
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([0-2]?\d|30|31)(?:th|st|nd|rd|)((?:,?\s[0-3]?\d(?:th|st|nd|rd|)){0,6}),?(\/|\s?(?:[-–]|&ndash;)\s?|\s(?:and|to|&)\s)([0-2]?\d|30|31)(?:th|st|nd|rd|),?\s(?:of\s|)(\d{3,4}\W\D)", "$1$3$4$5$6 $2 $7");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([0-2]?\d|30|31)(?:th|st|nd|rd|)((?:,?\s[0-3]?\d(?:th|st|nd|rd|)){0,6}), ([0-2]?\d|30|31)(?:th|st|nd|rd|)(?=\W\D|[ ]*\r)", "$1$3$4, $5 $2");
 //convert md,d,d, date ranges to d,d,dm  (multiple, separated by commas)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([1-2]?\d|30|31)(?:th|st|nd|rd|)((?:,?\s[0-3]?\d(?:th|st|nd|rd|)){0,6}),?(\/|\s?(?:[-–]|&ndash;)\s?|\s(?:and|to|&)\s)([0-2]?\d|30|31)(?:th|st|nd|rd|)(?=\W\D|[ ]*\r)", "$1$3$4$5$6 $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))((?:\s[1-3]?\d(?:th|st|nd|rd|),?){1,6})(\s(?:and|to|&|&ndash;)\s)([0-2]?\d|30|31)(?:th|st|nd|rd|)(?=\W\D|[ ]*\r)", "$1$3$4$5 $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([1-2]?\d|30|31)(?:th|st|nd|rd|)((?:,?\s[1-3]?\d(?:th|st|nd|rd|)){1,6})(?=\W\D|[ ]*\r)", "$1$3$4 $2");
 //convert md date ranges to dm  (simple, separated by hyphens and dashes  or 'to')
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([1-2]?\d|30|31)(?:th|st|nd|rd|)(\s?(?:[-–]|&ndash;)\s?|\sto\s)(?:\2\s|)([0-2]?\d|30|31)(?:th|st|nd|rd|)(?=\W\D|[ ]*\r)", "$1$3 $4$5 $2");
 //'md, md,' to 'dm, dm,'
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D)( (Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|)))( [0-2]?\d|30|31),( (Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|)))( [0-2]?\d|30|31)([,\.]\W\D)", "$1$3$2,$5$4,$6");
 //convert simple mdy dates to dmy
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([0-2]?\d|30|31)(?:th|st|nd|rd|),?\s(\d{1,4}\s?(?:AD|BC|CE|BCE)\W\D)", "$1$3 $2 $4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([0-2]?\d|30|31)(?:th|st|nd|rd|),?\s([12]\d{3})(?=\W\D|[ ]*\r)", "$1$3 $2 $4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s([0-2]?\d|30|31)(?:th|st|nd|rd|)(?=\W\D|[ ]*\r)", "$1$3 $2");
 //Month+day_number "March 7th" -> "March 7"
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)([0-2]?\d|30|31)(?:th|st|nd|rd|)\s(Jan(?:uary|.)|Feb(?:ruary|.)|Mar(?:ch|.)|Apr(?:il|.)|May|June?|July?|Aug(?:ust|.)|Sep(?:tember|.)|Oct(?:ober|.)|Nov(?:ember|.)|Dec(?:ember|.))(\W\D)", "$1$2 $3$4");
 //expand month names
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Jan (\d{4})", "$1 January $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Feb (\d{4})", "$1 February $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Mar (\d{4})", "$1 March $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Apr (\d{4})", "$1 April $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Jun (\d{4})", "$1 June $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Jul (\d{4})", "$1 July $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Aug (\d{4})", "$1 August $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Sep (\d{4})", "$1 September $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )Oct (\d{4})", "$1 October $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(date ?= ?[1-3]?\d )(Sept|Nov|Dec) (\d{4})", "$1 $2ember $3");
 //remove leading zero from nonlinked date
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)0(\d)(?:th|st|nd|rd|)\s(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\s(\d{4})(?=\W\D|[ ]*\r)", "$1$2 $3 $4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D\W)0(\d)(?:th|st|nd|rd|)\s(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))(?=\W\D|[ ]*\r)", "$1$2 $3");
 //rem duplicated months in date formats //code not functioning as intended
ArticleText=Regex.Replace(ArticleText, @"(?i)([1-2]?\d|30|31)(?:th|st|nd|rd|)\s(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s+(to|[\-–—])\s+([1-2]?\d|30|31)(?:th|st|nd|rd|)\s\2(?=\W)", "$1 $3 $4 $2"); //7189
 //rem ordinals and redundant spaces (and commas) in date ranges
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D)0?([1-2]?\d|30|31)(?:th|st|nd|rd|)\s+(to|[\-–—])\s+0?([1-2]?\d|30|31)(?:th|st|nd|rd|)\s(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)(?=\W)", "$1$2 $3 $4 $5");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D)0?([1-2]?\d|30|31)(?:th|st|nd|rd|)\s(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?),\s?(\d{3,4})(?=\W)", "$1$2 $3 $4");
 //replace 'as of [date]' with 'updated [date]'
ArticleText=Regex.Replace(ArticleText, @"(?i)(\'\')As of ([0-2]?\d|30|31)\s(Jan(?:uary|.)|Feb(?:ruary|.)|Mar(?:ch|.)|Apr(?:il|.)|May|June?|July?|Aug(?:ust|.)|Sep(?:tember|.)|Oct(?:ober|.)|Nov(?:ember|.)|Dec(?:ember|.))\s?(20\d{2})(?=\.?\')", "$1Updated $2 $3 $4");
 //de-tagging for 'Use dmy dates|date='
ArticleText=Regex.Replace(ArticleText, @"(?i)\{\{(use (dmy|mdy) dates|dmy|mdy)(\|\s?cs1-dates=ly|)(\s*\|[^}]*)?\}\}\n?", "{{Use dmy dates|date=November 2024}}");
 ///General formatting
 //adding piping to parentheticals
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[([^\[\]\(\)\|:]*)[ _](\([^\[\]\(\)\|]*(?:album|band|born \d{4}|film|magazine|newspaper|song)\))(\]\])", "[[$1 $2|$1$3");	//adding piping to parentheticals
 //Remove comma between month and year
ArticleText=Regex.Replace(ArticleText, @"(?i)(Jan(?:\.?|uary)|Feb(?:\.?|ruary)|Mar(?:\.?|ch)|Apr(?:\.?|il)|May|Jun(?:\.?|e)|Jul(?:\.?|y)|Aug(?:\.?|ust)|Sept?(?:\.?|ember)|Oct(?:\.?|ober)|Nov(?:\.?|ember)|Dec(?:\.?|ember)),\s(\d{4})", "$1 $2");
 //improper capitalisation within section headings
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*External )(Links)(?=[ ]*=)", "$1links");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*See )(Also)(?=[ ]*=)", "$1also");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Box )O(ffice)(?=[ ]*=)", "$1o$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w]+? and )A(wards?|chievements?)(?=[ ]*=)", "$1a$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )A(lbums?)(?=[ ]*=)", "$1a$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )C(areer|haracters|ompositions)(?=[ ]*=)", "$1c$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )E(ducation)(?=[ ]*=)", "$1e$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )H(istory|onou?rs)(?=[ ]*=)", "$1h$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )L(evel|ife|isting)(?=[ ]*=)", "$1l$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*(?:1st|2nd|3rd|\dth) )M(atch)", "$1m$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*(?:1st|2nd|3rd|\dth) )F(inal)", "$1f$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*(?:First|Second|Third|Fourth|[1-4](?:st|nd|rd|th)) )P(lace)(?=[ ]*==)", "$1p$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*(?:First|Second|Third|Fourth|[1-4](?:st|nd|rd|th)) )Q(uarter)(?=[ ]*==)", "$1q$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*(?:First|Second|Third|Fourth|[1-4](?:st|nd|rd|th)) )R(ound)(?=[ ]*==)", "$1r$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*(?:CFL|N[BFH]L) )C(oaching )[Rr](ecords?)(?=[ ]*=)", "$1c$2r$3");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )R(ankings?|eading|esults?|eception|ecognition)(?=[ ]*=)", "$1r$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[-\w\s]+? )C(areer )S(tatistics)(?=[ ]*=)", "$1c$2s$3");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )S(eason|quad|tyle|tage|tatistics)(?=[ ]*=)", "$1s$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )P(ersonnel)(?=[ ]*=)", "$1p$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )R(esponses?)(?=[ ]*=)", "$1p$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )T(ournaments?)(?=[ ]*=)", "$1t$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*[\w\s]+? )Y(ears)(?=[ ]*=)", "$1y$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Exhibition )S(chedule)(?=[ ]*=)", "$1s$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Regular )Season Schedule(?=[ ]*=)", "$1season schedule");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Right )[Oo]f Reply(?=[ ]*=)", "$1of reply");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Terminated )D(estinations)(?=[ ]*=)", "$1d$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Twin )T(owns)(?=[ ]*=)", "$1t$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Twin )(Towns [Aa]nd [Ss]ister [Cc]ities)(?=[ ]*=)", "$1towns and sister cities");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Heraldic )(Items)(?=[ ]*=)", "$1items");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Campaign )C(redits)(?=[ ]*=)", "$1c$2");
ArticleText=Regex.Replace(ArticleText, @"(==[ ]*Combat )C(hronicle)(?=[ ]*=)", "$1c$2");
 //other improper capitalisation
ArticleText=Regex.Replace(ArticleText, @"([ ]*(?:\d\d?\W |)(?:CD |Cassette ))S(ingles?)\b", "$1s$2");
ArticleText=Regex.Replace(ArticleText, @"([ ]*(?:\d\d?\W |CD |Cassette ))S(ingles?)\b", "$1s$2");
ArticleText=Regex.Replace(ArticleText, @"\b(Bowling |Batting )S(tyle)\b", "$1s$2");
ArticleText=Regex.Replace(ArticleText, @"\b(lef|righ)t-Handed Opening B(atsman)\b", "$1t-handed opening b$2");
ArticleText=Regex.Replace(ArticleText, @"\b(lef|righ)t-Handed Top Order B(atsman)\b", "$1t-handed top-order b$2");
ArticleText=Regex.Replace(ArticleText, @"\b([Aa]ll)[- ]R(ounder)\b", "$1-r$2");
ArticleText=Regex.Replace(ArticleText, @"\b(Wicket)[- ]K(eeper)\b", "$1-k$2");
ArticleText=Regex.Replace(ArticleText, @"\b(fast)[-– ](medium )B(owler)\b", "$1–$2b$3");
ArticleText=Regex.Replace(ArticleText, @"\b([Ff]ast |[Mm]edium )B(owler)\b", "$1b$2");
ArticleText=Regex.Replace(ArticleText, @"\b([Ff]ast|[Ss]low)[-– ](lef|righ)t-[Aa]rm B(owler)\b", "$1 $2-arm b$3");
ArticleText=Regex.Replace(ArticleText, @"\b(fast)[- ]B(owler)\b", "$1-b$2");
ArticleText=Regex.Replace(ArticleText, @"\b([Ll]eg|[Oo]ff)[- ][Ss](pin )B(owler)\b", "$1-s$2b$3");
ArticleText=Regex.Replace(ArticleText, @"\b(st|nd|rd|th) G(rade)\b", "$1 g$2");
ArticleText=Regex.Replace(ArticleText, @"(\'Further )R(eading)(?=\')", "$1r$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )A(nd|t) A(n? \w)", "$1a$2 a$3");
ArticleText=Regex.Replace(ArticleText, @"(\w )A(nd|t) (My \w)", "$1a$2 $3");
ArticleText=Regex.Replace(ArticleText, @"(\w )A(nd|t) T(he \w)", "$1a$2 t$3");
ArticleText=Regex.Replace(ArticleText, @"(\w )By A(n? \w)", "$1by a$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )By (My \w)", "$1by $2");
ArticleText=Regex.Replace(ArticleText, @"(\w )By T(he \w)", "$1by t$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )For A(n? \w)", "$1for a$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )For (My \w)", "$1for $2");
ArticleText=Regex.Replace(ArticleText, @"(\w )For T(he \w)", "$1for t$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )In A(n? \w)", "$1in a$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )In (My \w)", "$1in $2");
ArticleText=Regex.Replace(ArticleText, @"(\w )In T((?:he|o) \w)", "$1in t$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )I(nto \w)", "$1i$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )O(f|n|r) A(n? \w)", "$1o$2 a$3");
ArticleText=Regex.Replace(ArticleText, @"(\w )O(f|n|r) (My \w)", "$1o$2 $3");
ArticleText=Regex.Replace(ArticleText, @"(\w )O(f|n|r) T(he \w)", "$1o$2 t$3");
ArticleText=Regex.Replace(ArticleText, @"(\w )To A(n? \w)", "$1to a$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )To (My \w)", "$1to $2");
ArticleText=Regex.Replace(ArticleText, @"(\w )To T(he \w)", "$1to t$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )With A(n? \w)", "$1with a$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )With M(y \w)", "$1with M$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )With T(he \w)", "$1with t$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )A(t \w)", "$1a$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )I(n \w)", "$1i$2");
ArticleText=Regex.Replace(ArticleText, @"(\w )O([fn] \w)", "$1o$2"); //'Or' - false positive (with heraldric Or); 'On' - name (e.g. Ma On Shan)
ArticleText=Regex.Replace(ArticleText, @"(Bring |Turn )[Ii]t o(n)", "$1It O$2"); //reverting proper name - title of song or work
ArticleText=Regex.Replace(ArticleText, @"(Carry )o(n [A-Z]\w*|n film)", "$1O$2"); //reverting proper name - 'Carry On' film series
ArticleText=Regex.Replace(ArticleText, @"(Ma )o(n Shan)", "$1O$2"); //reverting proper name - 'Ma On Shan'
ArticleText=Regex.Replace(ArticleText, @"(NZ |New Zealand )o(n Air|n Screen)", "$1O$2"); //reverting proper name - 'NZ On Air'
ArticleText=Regex.Replace(ArticleText, @"in t(he [Aa]ir [Tt]onight)", "In t$1"); //reverting per "In the Air Tonight"
ArticleText=Regex.Replace(ArticleText, @"in t(he Flesh [Tt]our)", "In t$1"); //reverting per "In the Flesh tour"
ArticleText=Regex.Replace(ArticleText, @"(\W)o(n This Day)", "$1O$2"); //reverting per "on This Day"
ArticleText=Regex.Replace(ArticleText, @"(Star Trek )into( Darkness)", "$1Into$2"); //reverting proper name - title of work
 //rem redundant spaces underlining and punctuation
ArticleText=Regex.Replace(ArticleText, @"(?i)(\W)[“](\[?\w+)", "$1\"$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\w+\]?)(,|\.|)[”](\W)", "$1\"$2$3"); //quotemark plus incidental LQ
ArticleText=Regex.Replace(ArticleText, @"(?i)(\W)[‘`´’](\[?\w+)", "$1\'$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\w+\]?\.?)[‘`´’](\W)", "$1\'$2"); // replace various single quotes and prime symbol with straight apostrophe
ArticleText=Regex.Replace(ArticleText, @"(?i)([\w;,\]\)>] ) +([\[\w(])", "$1$2");	//rem multiple spaces except when preceded by full stop
ArticleText=Regex.Replace(ArticleText, @"(?i)(<\/?ref(?: name=[^\<\>\/]*?|)>)[ ,\. ]*(<ref)", "$1$2");	// remove punctuation between ref tags
ArticleText=Regex.Replace(ArticleText, @"(?i)[ ]{1,3}(<\/?ref(?:>| >| n))", "$1"); // remove spaces preceding ref tags and templates
ArticleText=Regex.Replace(ArticleText, @"(?i)(\d),&nbsp;([12]\d{3}\b)+", "$1, $2");	//removes nbsp preceding year
ArticleText=Regex.Replace(ArticleText, @"(?i)(\d)(?:&nbsp;| )%", "$1%"); //removes nbsp preceding '%'
ArticleText=Regex.Replace(ArticleText, @"(?i)(&nbsp;)[ ](–|&ndash;)", "$1$2"); //Palliative for dashes script insertion of space after nbsp
ArticleText=Regex.Replace(ArticleText, @"\b(US|UK|A(?:US|)|C(?:AN|)|NZ|HK) ([$£¥€])(\d)", "$1$2$3");
ArticleText=Regex.Replace(ArticleText, @"\{\{AUD\}\} ?(\d+)", "A$ $1");
ArticleText=Regex.Replace(ArticleText, @"([$£¥€]) (\d)", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(\{\{(?:INR|Indian Rupee)\}\}|Rs\.?)(\d+)", "$1 $2");
 //rem 'external' wiktionary links
ArticleText=Regex.Replace(ArticleText, @"(?i)\[https?:\/\/en\.wiktionary\.org\/wiki\/[\w]*[ ](\w[^\]]*)\]", "$1");
 //rem leading and lagging spaces within wikilinks
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)[ ]+([^\[\]\|]*?)[ ]*(\]\])", "$1$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)[ ]*([^\[\]\|]*?)[ ]+(\]\])", "$1$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[[^\[\]\|]*?[ ])[ ]+([^\[\]]*?\]\])", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[[^\[\]\|]*?)[ ]+\|[ ]*([^\[\]]+\]\])", "$1|$2");
 //symbol for 'times' and dashes
 //	ArticleText=Regex.Replace(ArticleText, @"(?i)&times;", "×");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\d) x (\d )", "$1&nbsp;×&nbsp;$2");
ArticleText=Regex.Replace(ArticleText, @"\s(A[cglmrstu]|B[ahikrad]?|C[adeflmno]|D[bsyrsu]|E[rsu]|F[elmr]?|G[adef]|H[fgos]|I[nr]?|Kr?|L[aruv]|M[dgnot]|N[abdeiop]?|Os?|P[abdmortu]?|R[abefghnu]|S[bcegimnr]?|T[abcehilm]?|U[ub][neopst]|V|W|Xe|Yb?|Z[nr])-(Br|Cl?|F|H|I|N|O|P|Se?)\s", " $1–$2 "); //signifying chemical bonds abbrev
ArticleText=Regex.Replace(ArticleText, @"(?i)&mdash;", "—");
ArticleText=Regex.Replace(ArticleText, @"(?i)([\w\d]) — (?=[\w\d])", "$1 – "); // tweak to avoid replacing emdashes in strings that are in non-roman unicode characters
ArticleText=Regex.Replace(ArticleText, @"(?i)(\D7\d7)–(\d(?:00|)\D)", "$1-$2"); //airplane model numbers taking hyphen
 //inserting a white space between wikilinks to avoid errors upon unlinking
ArticleText=Regex.Replace(ArticleText, @"(?i)(\]\][\.,]?)(\[\[)(?!file|image)", "$1 $2");
 //full stop and nbsp fixes
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*(?:kw)\b", "$1&nbsp;kW");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*(?:khz)\b", "$1&nbsp;kHz");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*(?:m[Hh]z)\b", "$1&nbsp;MHz");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*(?:g[Hh]z)\b", "$1&nbsp;GHz");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*(?:kph|kphr|kmh|kmhr|kmph|kmphr|km\/hr)\b", "$1&nbsp;km/h");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*(?:m\.p\.h\.)\b", "$1&nbsp;mph");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*(gm|kg|km)s?\b", "$1&nbsp;$2");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*KMs?\b", "$1&nbsp;km");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*KGs?\b", "$1&nbsp;kg");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*(?:K(g|m))s?\b", "$1&nbsp;k$2");
ArticleText=Regex.Replace(ArticleText, @"(\d\.\d?\d| \d{1,3}| \d{1,3},\d{3})[ ]*cms?", "$1&nbsp;cm");
 //turn letter 'x' into symbol '×'
ArticleText=Regex.Replace(ArticleText, @"(?i)(\d)\sx\s(\d{1,3})\sin\s\(", "$1 × $2 in (");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\d)\sx\s(\d{1,3})\sinch\s", "$1 × $2 inch ");
 // Convert degree symbols into ° symbol, ensure preceding space
ArticleText=Regex.Replace(ArticleText, @"&deg;", "°");
 //	ArticleText=Regex.Replace(ArticleText, @"º", "°");
 //Celsius or Fahrenheit
ArticleText=Regex.Replace(ArticleText, @"(\d)&nbsp;(?:[°º]|deg|degree|degrees)&nbsp;([CF]\W)", "$1&nbsp;°$2");
ArticleText=Regex.Replace(ArticleText, @"(\d)(?:[°º]|deg|degree|degrees)&nbsp;([CF]\W)", "$1&nbsp;°$2");
ArticleText=Regex.Replace(ArticleText, @"(\d)&nbsp;(?:[°º]|deg|degree|degrees)([CF]\W)", "$1&nbsp;°$2");
ArticleText=Regex.Replace(ArticleText, @"(\d)(?:\s|)(?:[°º]|deg|degree|degrees)(?:\s|)([CF]\W)", "$1&nbsp;°$2");
ArticleText=Regex.Replace(ArticleText, @"(\d)(?:\s|&nbsp;)?(?=\[\[Celsius\|[°º]C\]\])", "$1&nbsp;$2");
ArticleText=Regex.Replace(ArticleText, @"(\d)(?:\s|&nbsp;)?(?=\[\[Fahrenheit\|[°º]F\]\])", "$1&nbsp;$2");
ArticleText=Regex.Replace(ArticleText, @"([^\d\(\)\/\\]\s)(-?\d[\d,\.]*)(?:\s|-|&nbsp;|)[°º]F([:;,\.?!]?\s[^\d\(\)\/\\])", "$1{{convert|$2|°F|°C|abbr=on}}$3");
ArticleText=Regex.Replace(ArticleText, @"([^\d\(\)\/\\]\s)(-?\d[\d,\.]*)(?:\s|-|&nbsp;|)(?:deg|degree|degrees)(?:\s|-|&nbsp;|)Fahrenheit([:;,\.?!]?\s[^\d\(\)\/\\])", "$1{{convert|$2|°F|°C}}$3");
 //remove commas from numerical values in convert template
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{convert\|\d+),(\d)", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{convert\|\d+),(\d)", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{convert\|\d+),(\d)", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{convert\|\d+),(\d)", "$1$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{convert\|\d+),(\d)", "$1$2");
 //remove leading zeros from convert template
ArticleText=Regex.Replace(ArticleText, @"(?i)(\{\{convert\s*\|)\s*0+(?=[1-9])", "$1$2");
 ///per WP:COMMONALITY
ArticleText=Regex.Replace(ArticleText, @"(?i)([Ff])reshman (year)", "$1irst $2");
ArticleText=Regex.Replace(ArticleText, @"(?i)([Ss])ophomore (album|year)", "$1econd $2");
 //Currency notation placements  [$£₤¥€]
ArticleText=Regex.Replace(ArticleText, @"(?i)\s(\$(?:\d+\.\d\d?|\d{1,3}|\d{1,3},\d{3}))((?:\s|&nbsp;)(?:m|b|tr)illion|)[ ]*(?:US(?:[D$]|\s?dollars?))\b", " US$1$2");
 ///dashes
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|(?:1[89]|20)\d{2})-(\d{2}\]\])", "$1–$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[1[89]\d{2})-(\d{2}\D)", "$1–$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[20[01]\d)-([012]\d\D)", "$1–$2");
 // removing external links within publisher/journal/work fields
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?(?:newspaper|work|journal|publisher)\s*\=\s*)\[https?:\/\/[^\s\]]*\s([\w\d][^\]]*)\]", "$1$2"); //1373
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?author(?:link\d?|)\s*\=\s*)\[https?:\/\/[^\s\]]*\s([\w\d][^\]]*)\]", "$1$2"); //108
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?(?:newspaper|work|journal|publisher|author)\s*\=\s*)www\.([\w\d][^\|\}]*)(?=[\|\}])", "$1$2"); //54840 "www"
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?author(?:link\d?|)\s*\=\s*)www\.([\w\d][^\|\}]*)(?=[\|\}])", "$1$2"); //275
 //citation template fixes
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?)published\s?=", "$1publisher=");
 // rem copyright assertion
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?publisher\s*\=\s*)(?:\[\[copyright(?:\|©|)\]\])\s?", "$1"); //54
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?publisher\s*\=\s*)(?:©|copyright)\s?", "$1");
 // rem toggles and redundant quote marks
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?(?:agency|author|newspaper|work|journal|publisher)\s*\=\s*)\'\'([^\|\}]+)\'\'(?=\s*[\}\|])", "$1$2"); //without link
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?(?:agency|author|newspaper|work|journal|publisher)\s*\=\s*)\'\'(\[\[(?:[^\|]+\||)[^\|\]]+\]\])\'\'(?=\s*[\}\|])", "$1$2");  //with link
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?title\s*\=\s*)\'&#39;([^\|\{\}]+)\'&#39;", "$1$2"); //rem &#39; in titles
 // Sources NZ Limited, Nine Media Corporation
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s*publisher\s*\=\s*)\((\[\[[^\|\{\}]+)(\|[^\]]*|)(\]\])\)", "$1$2$3$4"); //rem parenthetical publishers (1373)
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher(\s*=\s*)(\[\[)encyclop(?:æ|a|e)(?:e|)dia Britannica(?:[ ,] ?Inc\.?| \(?company\)?)(\|[^\]]+|)(\]\])\s?", ""); //(425)
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher(\s*=\s*)encyclop(?:æ|a|e)(?:e|)dia Britannica(?:[ ,] ?Inc\.?| \(?company\)?)\s?", ""); //(1374)
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Google (?:Books?|Livres?|Böcker|Boeken|Knihy|Książki|Sách)(?: Archive|)|books\.google\.com)(\|[^\]]+|)(\]\])\s?", "");
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Google (?:Books?|Livres?|Böcker|Boeken|Knihy|Książki|Sách)(?: Archive|)|books\.google\.com)", "");
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher(\s*=\s*)(\[\[)(?:The |)Hearst (?:Communications?(?:(?:,|) Inc\.?|)|Corporation|Newspapers(?:, LLC\.?|)|Entertainment|Magazines(?: UK|)|Publi(?:cations|shing)|UK|\(?media\)?)(\|[^\]]+|)(\]\])\s?", ""); //1661 1830 2837
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher(\s*=\s*)(?:The |)Hearst (?:Communications?(?:(?:,|) Inc\.?|)|Corporation|Newspapers(?:, LLC\.?|)|Entertainment|Magazines(?: UK|)|Publi(?:cations|shing)|UK|\(?media\)?)\s?", ""); //2024-10-11, 1908
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher(\s*=\s*)(\[\[)(?:IPC Media(?: Ltd\.?|)|TI Media|Future plc)(\|[^\]]+|)(\]\])\s?", ""); //6134
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher(\s*=\s*)(?:IPC Media(?: Ltd\.?|)|TI Media|Future plc)\s?", ""); //1264
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher(\s*=\s*)(\[\[)Trinity Mirror(\|[^\]]+|)(\]\])\s?", ""); //6134
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher(\s*=\s*)Trinity Mirror\s?", ""); //1264
 //Asia
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Al(?:-| |)j[ae]zeera(?: |'|)(?:\(?Arabic\)?|News|Television|TV|\.net|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Al Jazeera$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Al(?:-| |)j[ae]zeera(?: |'|)(?:\(?Arabic\)?|News|Television|TV|\.net|\.com|)", "publisher$2Al Jazeera");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)(?:The ?|)(?:Hindu ?|)Business ?Line(?:\.com|)(?:\|[^\]]+|)(\]\])", "$1$2$3Business Line$4|location=Chennai");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(?:The ?|)(?:Hindu ?|)Business ?Line(?:\.com|)", "$1$2Business Line|location=Chennai");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)Business Line", "work$2$3Business Line");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)dawn ?(dawn|\(?newspaper\)?|\(?pakistan\)?|, karachi|\.com)(?:\|[^\]]+|)(\]\])", "newspaper$2Dawn|location=Pakistan");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)dawn ?(?:dawn|\(?newspaper\)?|\(?pakistan\)?|, karachi|\.com|)", "newspaper$2Dawn|location=Pakistan");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)deccan ?chronicle(?:\.com|)(?:\|[^\]]+|)(\]\])", "$1$2$3Deccan Chronicle$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)deccan ?chronicle(?:\.com|)", "$1$2Deccan Chronicle");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Deccan Chronicle", "work$2$3Deccan Chronicle");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)(?:the ?|)Hindustan ?times(?:\.com|)(?:\|[^\]]+|)(\]\])", "$1$2$3Hindustan Times$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(?:the ?|)Hindustan ?times(?:\.com|)", "$1$2Hindustan Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)Hindustan Times", "work$2$3Hindustan Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)Telegraph(?: of Calcutta| \(?(?:Indian Newspaper|India|Calcutta|Kolkatt?a)\)?|India\.com|, Calcutta)(?:\|[^\]]+|)(\]\])", "$1$2The Telegraph|location=India");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |\w+\.|)economic ?times(?:\.indiatimes|)(?:\.com|(?: of|) \(?India\)?|)(?:\|[^\]]+|)(\]\])", "$1$2$3The Economic Times$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |\w+\.|)economic ?times(?:\.indiatimes|)(?:\.com|(?: of|) \(?India\)?|)", "$1$2The Economic Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)The Economic Times", "work$2$3The Economic Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |)Telegraph(?: of Calcutta| \(?(?:Indian Newspaper|India|Calcutta|Kolkatt?a)\)?|India\.com|, Calcutta)", "$1$2The Telegraph|location=India");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Hindu|the|) ?Hindu(?:\.com| \(?(?:newspaper|online)\)?|)(?:\|[^\]]+|)(\]\])", "$1$2$3The Hindu$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Hindu|the|) ?Hindu(?:\.com| \(?(?:newspaper|online)\)?|)", "$1$2The Hindu");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Hindu", "work$2$3The Hindu");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:the |)(?:Jpost|jerusalem ?post)(?:\.com|)(?:\|[^\]]+|)(\]\])", "$1$2$3The Jerusalem Post$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Jpost|jerusalem ?post)(?:\.com|)", "$1$2The Jerusalem Post");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Jerusalem Post", "work$2$3The Jerusalem Post");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:\w+\.|)philstar(?:\.com|)|(?:The |)Philippine Star)(?:\|[^\]]+|)(\]\])", "$1$2$3The Philippine Star$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:\w+\.|)philstar(?:\.com|)|(?:The |)Philippine Star)", "$1$2The Philippine Star");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)The Philippine Star", "work$2$3The Philippine Star");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:\w+\.|The |)Indian ?Express(?:\.com|)|Express India)(?:\|[^\]]+|)(\]\])", "$1$2$3The Indian Express$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:\w+\.|The |)Indian ?Express(?:\.com|)|Express India)", "$1$2The Indian Express");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)The Indian Express", "work$2$3The Indian Express");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:The |\w+\.|)Times ?of ?India(?:\.com|\.indiatimes\.com|)|India Times)(?:\|[^\]]+|)(\]\])", "$1$2$3The Times of India$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:The |\w+\.|)Times ?of ?India(?:\.com|\.indiatimes\.com|)|India Times)", "$1$2The Times of India");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Times of India", "work$2$3The Times of India");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:the |)Times ?of ?israel(?:\.com|)(?:\|[^\]]+|)(\]\])", "$1$2$3The Times of Israel$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:the |)Times ?of ?israel(?:\.com|)", "$1$2The Times of Israel");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Times of Israel", "work$2$3The Times of Israel");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)xinhua ?(?:General News Service|(?:News|Press) ?(?:Agency|Service|)|net(?:\.com|)|)(?:\|[^\]]+|)(\]\])", "agency$2$3Xinhua News Agency$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\w+\.|)xinhua ?(General News Service|(?:News|Press) ?(Agency|Service|)|net(?:\.com|)|)", "agency$2Xinhua News Agency");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)(?:\w+\.|)xinhua ?(General News Service|(?:News|Press) ?(Agency|Service|)|net(?:\.com|)|)(?:\|[^\]]+|)(\]\]|)''", "Xinhua News Agency");
 //Australia
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Nine(?:msn|)|9news) ?(?:\.com\.au|MSN|)(?:\|[^\]]+|)(\]\])", "publisher$2$3 9news.com.au$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Nine(?:msn|)\b|9news) ?(?:\.com\.au|MSN|)", "publisher$2 9news.com.au");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:ABC News(?: \(?Australia\)?| Online)|Australian Broadcasting Corporation News)(?:\|[^\]]+|)(\]\])", "publisher$2ABC News|location=Australia");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:ABC News(?: \(?Australia\)?| Online)|Australian Broadcasting Corporation News)(?:\.com|)(?=[\|\s}])", "publisher$2ABC News|location=Australia");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:abs\.gov\.au|Australian Bureau of Statistics)(?:\|[^\]]+|)(\]\])", "publisher$2$3Australian Bureau of Statistics$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:abs\.gov\.au|Australian Bureau of Statistics)", "publisher$2Australian Bureau of Statistics");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:ABC ?(?:\(?Australian Broadcasting Corporation\)?|\(?Australian television\)?|\(?Australia\)?|Online|\.net\.au|)|Australian? ?Broadcast(?:ing|) (?:Corporation \(ABC\)|Corp(?:oration|)|Commission))(?:\|[^\]]+|)(\]\])", "publisher$2$3Australian Broadcasting Corporation$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:ABC ?(?:\(?Australian Broadcasting Corporation\)?|\(?Australian television\)?|\(?Australia\)?|Online|\.net\.au)|Australian? ?Broadcast(?:ing|) (?:Corporation \(ABC\)|Corp(?:oration|)|Commission))", "publisher$2Australian Broadcasting Corporation");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:National |)Nine News(?: Australia|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Nine News$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:National |)Nine News(?: Australia|)", "publisher$2Nine News");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:ABC|Australian Broadcasting Corporation) (?:RN|Radio National)(?:\|[^\]]+|)(\]\])", "publisher$2$3Radio National$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:ABC|Australian Broadcasting Corporation) (?:RN|Radio National)", "publisher$2Radio National");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Stuff(?:\.co\.nz| Ltd\.?| Limited| \(?(?:Company|Fairfax|website)\)?| New Zealand| NZ)(?:\|[^\]]+|)(\]\])", "publisher$2Stuff|location=New Zealand");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Stuff(?:\.co\.nz| Ltd\.?| Limited| \(?(?:Company|Fairfax|website)\)?| New Zealand| NZ)", "publisher$2Stuff|location=New Zealand");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)Daily ?Telegraph(?: \(?(?:Australia|Sydney)\)?|\.com\.au)(?:\|[^]]+|)?(\]\])", "$1$2The Daily Telegraph|location=Sydney");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |)Daily ?Telegraph(?: \(?(?:Australia|Sydney)\)?|\.com\.au)", "$1$2The Daily Telegraph|location=Sydney");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)(?:New Zealand ?|N\.? ?Z\.? ?)Herald(?:\.co\.nz| News|)(?:\|[^\]]+|)(\]\])", "$1$2$3The New Zealand Herald$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |)(?:New Zealand ?|N\.? ?Z\.? ?)Herald(?:\.co\.nz| News|)", "$1$2The New Zealand Herald");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The New Zealand Herald", "work$2$3The New Zealand Herald");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:The|) ?Sydney Morning(?: |-)Herald|smh(?:\.com\.au|))(?:\|[^\]]+|)(\]\])", "$1$2$3The Sydney Morning Herald$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:The|) ?Sydney Morning(?: |-)Herald|smh(?:\.com\.au|))", "$1$2The Sydney Morning Herald"); //v
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Sydney Morning Herald", "work$2$3The Sydney Morning Herald");
 //Canada
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:canada\.ca|Government of Canada)(?:\|[^\]]+|)(\]\])", "publisher$2$3Government of Canada$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:canada\.ca|Government of Canada)", "publisher$2Government of Canada");
 //Entertainment
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)All ?movie(?:\.com| ?Guide|)(?:\|[^\]]+|)(\]\])", "publisher$2$3AllMovie$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)All ?movie(?:\.com| ?Guide|)", "publisher$2AllMovie");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[|)All(?: |-|)Music(?: ?Guide|\.com|)(\]\]|)[\.,]? \(?(\[\[|)Rovi Corp\.?(oration|)(\]\]|)\)?", "publisher$2$3AllMusic$4"); //1,329
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)All(?: |-|)Music(?: ?Guide|\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3AllMusic$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)All(?: |-|)Music(?: ?Guide|\.com|)", "publisher$2AllMusic");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)billboard(?:'s| \(?(?:magazine|website|newspaper|magazine)\)?|\.(?:com|biz))(?:\|[^\]]+|)(\]\])", "magazine$2Billboard");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Billboard(?:\.com|\.biz| magazine|)", "magazine$2Billboard");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Billboard", "work$2$3Billboard");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Box ?Office ?India)(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Box Office India$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Box ?Office ?India)(?:\.com|)", "publisher$2Box Office India");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Box ?Office ?Mojo(?: \(?website\)?|\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Box Office Mojo$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Box ?Office ?Mojo(?: \(?website\)?|\.com|)", "publisher$2Box Office Mojo");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)(?:BFI|British ?Film ?Institute)(?:\.org\.uk|)(?:\|[^\]]+|)(\]\])", "publisher$2$3British Film Institute$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(?:BFI|British ?Film ?Institute)(?! s)(?:\.org\.uk| Collections Search|)", "publisher$2British Film Institute");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:bpi\.co\.uk|British Phonographic Institute)", "publisher$2British Phonographic Industry");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)digital ?spy(?:\.co\.uk|\.com(?:\.au|)|\.ie|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Digital Spy$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)digital ?spy(?:\.co\.uk|\.com(?:\.au|)|\.ie|)", "publisher$2Digital Spy");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Discogs(?:\.com|\.org|\.co\.uk|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Discogs$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Discogs(?:\.com|\.org|\.co\.uk|)", "publisher$2Discogs");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Fandango(?:\.com| Media, LLC| Media| \(?(?:movies|website|ticket service|company)\)?)(?:\|[^\]]+|)(\]\])", "publisher$2$3Fandango Media$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Fandango(?:\.com| Media, LLC| Media| \(?(?:movies|website|ticket service|company)\)?)", "publisher$2Fandango Media");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |m\.|)(?:IMDB|Internet ?Movie ?Data ?Base)(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3IMDb$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |m\.|)(?:IMDB|Internet ?Movie ?Data ?Base)(?:\.com|)", "publisher$2IMDb");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)(?:IMDB|Internet ?Movie ?Data ?Base)(?:\.com|)(?:\|[^\]]+|)(\]\]|)''", "$1IMDb$2"); // 868
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)itunes(?: Music Store| Plus| \(?store\)?s?|)(?:\|[^\]]+|)(\]\])", "publisher$2$3iTunes Store$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)itunes (?:music |)stores?", "publisher$2iTunes Store");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[?\[?)itunes\.apple(?:\.com?|)(?:\.[\w]{2}|)(\]?\]?)", "publisher$2$3iTunes Store$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)MTV( \w+|)(?:\.com| \((?:Music Television|TV Channel)\)|)(?:\|[^\]]+|)(\]\])", "publisher$2$3MTV $4$5");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)MTV( \w+|)(?:\.com| \((?:Music Television|TV Channel)\)|)", "publisher$2MTV $3");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)MTV(\]\]|)''", "$1MTV$2"); // 1,083
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[|)Metacritic(?:\.com|)(\]\]|)\.? \(?(\[\[|)CBS Interactive(\]\]|)\)?", "publisher$2$3Metacritic$4"); //494
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Metacritic(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Metacritic$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Metacritic(?:\.com|)", "publisher$2Metacritic");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:New Musical Express|N ?M ?E(?:\.com| \(?(?:magazine|website|Japan|Australia|Asia)\)?|))(?:\|[^\]]+|)(\]\])", "$1$2$3NME$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:New Musical Express|N ?M ?E(?:\.com| \(?(?:magazine|website|Japan|Australia|Asia)\)?|))", "$1$2NME");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)NME", "work$2$3NME");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)Official(?: UK|) ?Charts?(?: Company|\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Official Charts Company$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |)Official(?: UK|) ?Charts?(?: Company|\.com|)", "publisher$2Official Charts Company");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:People ?(?:\(?magazine\)?|\(?American magazine\)?|))(?:\.com|\.co\.uk|weekly|)(?:\|[^\]]+|)(\]\])", "$1$2$3People (magazine)|People$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:People ?(?:\(?magazine\)?|\(?American magazine\)?|))(?:\.com|\.co\.uk|weekly|)", "$1$2People");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)People", "work$2$3People");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:R\.?I\.?A\.?A\.?|Recording Industry Association of America|Recording Industry of America)(?:\|[^\]]+|)(\]\])", "publisher$2$3Recording Industry Association of America$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:R\.?I\.?A\.?A\.?(?:\.com|)|Recording Industry Association of America|Recording Industry of America)", "publisher$2Recording Industry Association of America");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[|)robertchristgau\.com", "publisher$2robertchristgau.com");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Rolling ?Stone(?:\.com| \(?magazine\)?|)(?:\|[^\]]+|)(\]\])", "$1$2$3Rolling Stone$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Rolling Stone(?:\.com| \(?magazine\)?|)", "$1$2Rolling Stone");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Rolling Stone", "work$2$3Rolling Stone");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)rotten(?: |-|)tomatoe?s(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Rotten Tomatoes$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)rotten(?: |-|)tomatoe?s(?:\.com|)", "publisher$2Rotten Tomatoes");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)\bSpin(?:\.com| \(?(?:magazine|website)|\)?)\b(?:\|[^\]]+|)(\]\])", "$1$2$3Spin (magazine)|Spin$4"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\bSpin(?:\.com| \(?(?:magazine|website)|\)?)\b", "$1$2Spin"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Spin\b", "work$2$3Spin"); //sc
 //Sports
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)AFL(?:\.com\.au| Media)(?:\|[^\]]+|)(\]\])", "publisher$2$3AFL Media$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)AFL(?:\.com\.au| Media)", "publisher$2AFL Media");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Cricket?Archive(?:\.co(?:m|\.uk)|)(?:\|[^\]]+|)(\]\])", "publisher$2$3CricketArchive$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Cricket?Archive(?:\.co(?:m|\.uk)|)", "publisher$2CricketArchive");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:ESPN(?!\.)(?: \(?United States\)?|)|Entertainment and Sports Programming Network)(?:\|[^\]]+|)(\]\])", "publisher$2$3ESPN$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:ESPN(?!\.)(?: \(?United States\)?|)|Entertainment and Sports Programming Network)", "publisher$2ESPN");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)\bespn(?:\.com|\.co\.uk|)\b(?:\|[^\]]+|)(\]\])", "publisher$2$3ESPN$4"); //3016
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\bespn(?:\.com|\.co\.uk|)\b", "publisher$2ESPN"); //20604
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)\bESPN\b(\]\]|)''", "$1ESPN$2"); //745
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:ESPN|) ?cricinfo(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3ESPNcricinfo$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:ESPN|) ?cricinfo(?:\.com|)\s*", "publisher$2ESPNcricinfo"); //v
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)ESPNcricinfo(\]\]|)''", "$1ESPNcricinfo$2"); //?
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:espn)? ?scrum(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3ESPNscrum$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:espn)? ?scrum(?:\.com|)", "publisher$2ESPNscrum");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)ESPNscrum(\]\]|)''", "$1ESPNscrum$2"); //?
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)\bespn ?FC(?:\.com|\.co\.uk|)\b(?:\|[^\]]+|)(\]\])", "publisher$2$3ESPN FC$4"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\bespn ?FC(?:\.com|\.co\.uk|)\b", "publisher$2ESPN FC"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)\bespn ?Deportes(?:\.com|\.co\.uk|)\b(?:\|[^\]]+|)(\]\])", "publisher$2$3ESPN Deportes$4"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\bespn ?Deportes(?:\.com|\.co\.uk|)\b", "publisher$2ESPN Deportes"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:FIFA(?:\.com|))|Federation of International Football Association)(?:\|[^\]]+|)(\]\])", "publisher$2$3FIFA$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:FIFA(?:\.com|))|Federation of International Football Association)", "publisher$2FIFA");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)FIFA(\]\]|)''", "$1FIFA$2"); //?
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Fox ?Sports(?:\.com\.au| \(?Australia\)?)", "publisher$2Fox Sports|location=Australia"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[|)Fox ?Sports(?:\.com|)", "publisher$2$3Fox Sports"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)Fox ?Sports(?:\.com\.au| \(?Australian TV network| \(?Australia\)?)(?:\|[^\]]+|)(\]\])", "publisher$2Fox Sports|location=Australia");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)Fox ?Sports(?:\.com\.au| \(?Australian TV network| \(?Australia\)?)", "publisher$2Fox Sports|location=Australia");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Goal ?\(?(?:\.com|website)\)?(?:\|[^\]]+|)(\]\])", "publisher$2$3Goal (website)|Goal$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Goal ?\(?(?:\.com|website)\)?", "publisher$2Goal");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Football Association of (?:Ireland|the Irish Free State)|FAI(?:\.ie|))(?:\|[^\]]+|)(\]\])", "publisher$2$3Football Association of Ireland$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Football Association of (?:Ireland|the Irish Free State)|FAI\b(?:\.ie|))", "publisher$2Football Association of Ireland");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)(?:NRL|National Rugby League)(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3National Rugby League$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |\w+\.|)(?:NRL|National Rugby League)(?:\.com|)", "publisher$2National Rugby League");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:RSSSF|Rec\.Sport\.Soccer Statistics Foundation)(?:\.com|\.org|)(?:\|[^\]]+|)(\]\])", "publisher$2$3RSSSF$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:RSSSF|Rec\.Sport\.Soccer Statistics Foundation)(?:\.com|\.org|)", "publisher$2RSSSF"); //v
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Rugby League Project|rugbyleagueproject(?:\.org|\.com))", "publisher$2Rugby League Project");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)\b(\s*=\s*)(\[\[)Sky ?Sports(?:\.com|\.co\.uk|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Sky Sports$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Sky ?Sports(?:\.com|\.co\.uk|)(?=[\]|\s}\n])", "publisher$2Sky Sports");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:SI|Sport'?s ?Illustrated)(?:\.com| \(?Magazine\)?|)(?:\|[^\]]+|)(\]\])", "$1$2$3Sports Illustrated$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|journal|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\b(?:SI|Sport'?s ?Illustrated)\b(?:\.com| \(?Magazine\)?|)", "$1$2Sports Illustrated");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Sports Illustrated", "work$2$3Sports Illustrated");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)(?:The Cricketer|Cricketer \(?magazine\)?|thecricketer\.com)(?:\|[^\]]+|)(\]\])", "$1$2$3The Cricketer$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(?:The Cricketer|Cricketer \(?magazine\)?|thecricketer\.com)", "$1$2The Cricketer");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)The Cricketer", "work$2$3The Cricketer");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)\b(\s*=\s*)(\[\[)(?:Turkish Football Federation|Tff\.org)(?:\|[^\]]+|)(\]\])", "publisher$2$3Turkish Football Federation$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Turkish Football Federation|Tff\.org)(?=[\]|\s}\n])", "publisher$2Turkish Football Federation");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:UEFA|Union of European Football Associations|United European Football Association)(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3UEFA$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:UEFA|Union of European Football Associations|United European Football Association)(?:\.com|)(?=[\|\s}])", "publisher$2UEFA");
 //United States
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)ABC ?News(?:(?:\.go|)\.com| \(?United States\)?|)(?:\|[^\]]+|)(\]\])", "publisher$2ABC News|location=United States");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)ABC ?News(?:(?:\.go|)\.com| \(?United States\)?|)", "publisher$2ABC News|location=United States");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Amazon(?:\.com\.au|\.com|\.co\.jp|\.fr|\.de|\.co\.uk| \((?:Company|website|retailer)\)?| books| Japan| UK| Inc\.?| Germany| India|, Inc\.|)(?:\|[^\]]+|)(\]\])", "publisher$2Amazon");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Amazon(?:\.com\.au|\.com|\.co\.jp|\.fr|\.de|\.co\.uk| \((?:Company|website|retailer)\)?| books| Japan| UK| Inc\.?| Germany| India|, Inc\.|)", "publisher$2Amazon");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Amnesty(?:\.org| International)(?:\|[^\]]+|)(\]\])", "publisher$2$3Amnesty International$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Amnesty(?:\.org| International)", "publisher$2Amnesty International");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)(?:AP|Associated Press)(?: (?:News|Online)|\.org|News\.com|)(?:\|[^\]]+|)(\]\])", "agency$2Associated Press");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |)(?:\bAP\b|Associated Press)(?: (?:News|Online)|\.org|News\.com|)", "agency$2Associated Press");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)(?:The |)(?:\bAP\b|Associated Press)(?: (?:News|Online)|\.org|News\.com|)(?:\|[^\]]+|)(\]\]|)''", "$1Associated Press$2"); //3,981
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s*publisher\s*=\s*(\[\[|)ABC News(\]\]|)\s*)\|\s*publisher\s*=\s*(\[\[|)(?:American|Australian) Broadcasting Corporation(\]\]|)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher\s*=\s*(\[\[|)(?:American|Australian) Broadcasting Corporation(\]\]|)\s*(\|\s*publisher\s*=\s*(\[\[|)ABC News(\]\]|))", "$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)bloomb[eu]rg(?! News)(?:\.com| L\.P\.|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Bloomberg News$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)bloomb[eu]rg(?! News)(?:\.com| L\.P\.|)(?! b)", "publisher$2Bloomberg News");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Bloomberg(?: Business|) News(?:\|[^\]]+|)(\]\])", "publisher$2$3Bloomberg News$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Bloomberg(?: Business|) News", "publisher$2Bloomberg News");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Bloomb[eu]rg|) ?Business ?week(?:\.com| Online| Magazine|)(?:\|[^\]]+|)(\]\])", "$1$2$3Bloomberg Businessweek$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Bloomb[eu]rg|) ?Business ?week(?:\.com| Online| Magazine|)", "$1$2Bloomberg Businessweek");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Bloomb[eu]rg BusinessWeek", "work$2$3Bloomberg Businessweek");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)(?:Central ?Intelligence ?Agency|C\.? ?I\.? ?A\.?)(?:\.gov|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Central Intelligence Agency$4"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(?:Central ?Intelligence ?Agency|C\.? ?I\.? ?A\.?)(?:\.gov|)(?=[\]|}\n\s])", "publisher$2Central Intelligence Agency"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)cbs ?news(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3CBS News$4"); //5825
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)cbs ?news(?:\.com|)", "publisher$2CBS News"); //8797
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:CNN ?(?:\.com|News|Entertainment|Travel|Politics|Wire|Health|)|Cable News Network)(?:\|[^\]]+|)(\]\])", "publisher$2CNN"); //13,957
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(\w+\.|)CNN ?(?:\.com|Money|News|Entertainment|Travel|Politics|Wire|Health|)(?:\.com|)|Cable News Network)", "publisher$2CNN"); //34,937
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)(?:(\w+\.|)CNN ?(?:\.com|Money|News|Entertainment|Travel|Politics|Wire|Health|)(?:\.com|)|Cable News Network)(?:\|[^\]]+|)(\]\]|)''", "$1CNN$2"); //2091
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|encyclopedia|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)(?:Encyclop(?:a|e|æ)dia (?:of |)|)Britannica(?:\.com| Online|)(?:\|[^\]]+|)(\]\])", "$1$2$3Encyclopædia Britannica$4"); //12,427
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|encyclopedia|first|journal|last|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |)(?:Encyclop(?:a|e|æ)dia (?:of |)|)Britannica(?:\.com| Online|)", "$1$2Encyclopædia Britannica"); //12,436
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Encyclopædia Britannica", "work$2$3Encyclopædia Britannica"); //2,944
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)Fox ?News ?(?:\.com|Channel|Insider|Media|Network|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Fox News$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)Fox ?News ?(?:\.com|Channel|Insider|Media|Network|)", "publisher$2Fox News");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)global ?security(?:\.org|)(?:\|[^\]]+|)(\]\])", "publisher$2$3GlobalSecurity.org$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)global ?security(?:\.org|)", "publisher$2GlobalSecurity.org");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)(?:HRW|Human ?Rights? ?Watch)(?:\.org|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Human Rights Watch$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(?:HRW|Human ?Rights? ?Watch)(?:\.org|)", "publisher$2Human Rights Watch");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:International Monetary Fund|imf\.org)(?:\|[^\]]+|)(\]\])", "publisher$2$3International Monetary Fund$4"); //691
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:International Monetary Fund|imf\.org)", "publisher$2International Monetary Fund"); //1201
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:articles\.|The |)(?:L\.? ?A\.?|Los Angeles) ?Times(?:\.com| Media Group| News Service|)(?:\|[^\]]+|)(\]\])", "$1$2Los Angeles Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\w+\.|The |)(?:L\.? ?A\.?|Los Angeles) ?Times(?:\.com| Media Group| News Service|)", "$1$2Los Angeles Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Los Angeles Times", "work$2$3Los Angeles Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Merriam[ -–]Webster(?:\.com|,? Inc\.?(?:orporated|)| online|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Merriam-Webster$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Merriam[ -–]Webster(?:\.com|,? Inc\.?(?:orporated|)| online|)", "publisher$2Merriam-Webster");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)msn(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3MSN$4"); //2301
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\b(?:\w+\.|)msn\b(?:\.com|)", "publisher$2MSN"); //4095
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)NBC ?News(?:\.com|)(?:\|[^\]]+|)(\]\])", "publisher$2$3NBC News$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)NBC ?News(?:\.com|)", "publisher$2NBC News");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:NPR(?:\.com|\.org| One| Now| News|)|National ?Public ? Radio(?: \(?(?:United States|NPR)\)?|))(?:\|[^\]]+|)(\]\])", "publisher$2$3NPR$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:NPR(?:\.com|\.org| One| Now| News|)|National ?Public ? Radio(?: \(?(?:United States|NPR)\)?|))", "publisher$2NPR");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)(?:NPR(?:\.com|\.org| One| Now| News|)|National ?Public ? Radio(?: \(?(?:United States|NPR)\)?|))(?:\|[^\]]+|)(\]\]|)''", "$1NPR$2"); // 1388
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:PBS(?:\.org| International| News| Online| Television|)|Public Broadcasting (?:Service(?: \(PBS\)|)|Station|System))(?:\|[^\]]+|)(\]\])", "publisher$2$3PBS$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:PBS(?:\.org| International| News| Online| Television|)|Public Broadcasting (?:Service(?: \(PBS\)|)|Station|System))", "publisher$2PBS");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)PR ?Newswire ?(?:\.com|\.co\.uk|Association LLC|Association|Europe|)(?:\|[^\]]+|)(\]\])", "agency$2$3PR Newswire$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)PR ?Newswire ?(?:\.com|\.co\.uk|Association LLC|Association|Europe|)", "agency$2PR Newswire");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)R[ue][ue]ters ?(?:Alertnet|UK|South Africa|International|Television|News (?:Agency|Service)|Foundation|Limited|\.com|India|Pictures|News|)(?:\|[^\]]+|)(\]\])", "agency$2Reuters");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\w+\.|)R[ue][ue]ters ?(?:Alertnet|UK|South Africa|International|Television|News (?:Agency|Service)|Foundation|Limited|\.com|India|Pictures|News|)", "agency$2Reuters");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)Reuters(?:\|[^\]]+|)(\]\]|)''", "$1Reuters$2"); //2886
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:San Francisco|S\.? ?F\.?) ?(?:Gate|Chronicle|)(?:\.com|)(?:\|[^\]]+|)(\]\])", "$1$2$3San Francisco Chronicle$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:San Francisco|S\.? ?F\.?) ?(?:Gate|Chronicle)(?:\.com|)\b", "$1$2San Francisco Chronicle");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)San Francisco Chronicle", "work$2$3San Francisco Chronicle");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:\w+\.|)(?:(?:(?:N\.?|New) ?(?:Y\.?|York) ?(?:Times|T))(?:\.com|)|The New York Times)(?:\|[^\]]+|)(\]\])", "$1$2The New York Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\w+\.|)(?:(?:(?:N\.?|New) ?(?:Y\.?|York) ?(?:Times|T))(?:\.com|)|The New York Times)", "$1$2The New York Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)The New York Times", "work$2$3The New York Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)New York Times(\]\]|)''", "''$1The New York Times$2''");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:The |)Wall ?(?:Street|St\.?) ?Journals?|(?:The |online\.|)WSJ(?:\.com|))(?:\|[^\]]+|)(\]\])", "$1$2The Wall Street Journal");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:The |)Wall ?(?:Street|St\.?) ?Journals?|(?:The |\w+\.|)WSJ(?:\.com|))", "$1$2The Wall Street Journal");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Wall Street Journal", "work$2$3The Wall Street Journal");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)Washington ?Post ?(?:\.com|Live|Online|)(?:\|[^\]]+|)(\]\])", "$1$2The Washington Post");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |)Washington ?Post ?(?:\.com|Live|Online|)", "$1$2The Washington Post");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Washington Post", "work$2$3The Washington Post");
ArticleText=Regex.Replace(ArticleText, @"(?i)last(\s*=\s*)refugees\s*\|\s*first\s*=\s*United Nations High Commissioner for\s*\|", "author=UNHCR|"); //612
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[|)(?:UNHCR|United Nations High Commissioner for Refugees)(\]\]|)", "publisher$2$3United Nations High Commissioner for Refugees$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:The |)(?:U\.N\.|United Nation)s?(?: Organi[zs]ation|)|(?:\w+\.|(?:The |))\bUN\b(?:\.org|\.int|))(?:\|[^\]]+|)(\]\])", "publisher$2$3United Nations$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:The |)(?:U\.N\.|United Nation)s?(?: Organi[zs]ation|)|(?:\w+\.|(?:The |))\bUN\b(?:\.org|\.int|))", "publisher$2United Nations");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)USA ?Today(?:\.com| \(?newspaper\)?| Online|)(?:\|[^\]]+|)(\]\])", "$1$2$3USA Today$4"); //rs
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\w+\.|)USA ?Today(?:\.com| \(?newspaper\)?| Online|)", "$1$2USA Today");; //rs
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)USA Today", "work$2$3USA Today");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)\b(?:The |)(?:WHO|World Health Organi[sz]ation)(?: \(?WHO\)?|\.int|)(?:\|[^\]]+|)(\]\])", "publisher$2$3World Health Organization$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\b(?:The |)(?:WHO|World Health Organi[sz]ation)(?: \(?WHO\)?|\.int|)\b(?=\s*[\|\}])", "publisher$2World Health Organization");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Yahoo!?( \w+|)( \w+|)(?:\|[^\]]+|)(\]\])", "publisher$2$3Yahoo$4$5$6");; //11274
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Yahoo!?( \w+|)( \w+|)", "publisher$2Yahoo$3$4"); //25000
 //Western Europe
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)\b(?:AFP|Agence[- ]France[- ]Presse?)(?: \(?AFP\)?|\.com| \(?news(?: agency|)\)?|)\b(?:\|[^\]]+|)(\]\])", "agency$2$3Agence France-Presse$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\b(?:AFP|Agence[- ]France[- ]Presse?)(?: \(?AFP\)?|\.com| \(?news(?: agency|)\)?|)\b", "agency$2Agence France-Presse");
ArticleText=Regex.Replace(ArticleText, @"(?i)(title\s*=\s*)(BBC( news| sports?|) (‑|-|–|−|—|&ndash;|&mdash;) )", "$1"); //title
ArticleText=Regex.Replace(ArticleText, @"(?i)''(?:\[\[|)bbc\.co(?:\.uk|m)(?:\]\]|)''", "BBC"); //plain italics #1
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)BBC([^']+)(\]\]|)''", "$1BBC$2"); //plain italics #2
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:BBC|British Broadcasting Corp(?:oration|\.|))(?:\.com|\.co\.uk| \(BBC\)| UK|)(?:\|[^\]]+|)(\]\])", "publisher$1BBC"); //linked & piped
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:BBC|British Broadcasting Corp(?:oration|\.|))(?:\.com|\.co\.uk| \(BBC\)| UK|)", "publisher$1BBC"); //166185
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:genome\.ch\.bbc\.co\.uk|BBC Genome(?: Project|))(?:\|[^\]]+|)(\]\])", "publisher$1$2BBC Genome Project$3"); //Genome Project #B
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:genome\.ch\.bbc\.co\.uk|BBC Genome(?: Project|))", "publisher$1BBC Genome Project"); //Genome Project
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:BBC(?: Evening| National|) (?:Magazine|News)(?: Online|)|BBC\.com\/news|News\.BBC\.co\.uk)(?:\|[^\]]+|)(\]\])", "publisher$1BBC News"); //BBC News 32892
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:BBC(?: Evening| National|) (?:Magazine|News)(?: Online| website|)|BBC\.com\/news|News\.BBC\.co\.uk)", "publisher$1BBC News"); //BBC News 89808
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)BBC(?:\.co\.uk\/sport| Sports?)(?: Online|)(?:\|[^\]]+|)(\]\])", "publisher$1BBC Sport"); // BBC Sport 11557
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)BBC(?:\.co\.uk\/sport| Sports?)(?: Online| website|)", "publisher$1BBC Sport"); //BBC Sport 37536
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(BBC(?! News| Sport| Genome Project) \w+(?: \w+|))(?:\|[^\]]+|)(\]\])", "publisher$1$2$3$4"); //everything else 11922
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|via|website|work)(\s*=\s*)(BBC(?! News| Sport| Genome Project) \w+(?: \w+|))", "publisher$1$2"); //10237
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s*publisher\s*=\s*(\[\[|)BBC \w+(?: \w+|)(\]\]|)\s*)\|\s*publisher\s*=\s*(\[\[|)BBC(?! \w+)(\]\]|)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher\s*=\s*(\[\[|)BBC(?! \w+)(\]\]|)\s*(\|\s*publisher\s*=\s*(\[\[|)BBC \w+(?: \w+|)(\]\]|))", "$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s*publisher\s*=\s*(\[\[|)BBC \w+(?: \w+|)\s*)\|\s*publisher\s*=\s*(\[\[|)(?:(?:British Broadcasting Corporation\||)BBC(?! \w+))(\]\]|)", "$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s*publisher\s*=\s*(\[\[|)(?:(?:British Broadcasting Corporation\||)BBC(?! \w+))(\]\]|)\s*(\|\s*publisher\s*=\s*(\[\[|)BBC \w+(?: \w+|)(\]\]|))", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:\b(?:Evening|London|Standard) ?(?:Evening Standard?|Standard(?: \(London\))?|\.co\.uk|\.com)|thisislondon(?:\.co\.uk|\.com|))(?:\|[^\]]+|)(\]\])", "$1$2$3Evening Standard$4|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\b(?:Evening|London|Standard) ?(?:Evening Standard?|Standard(?: \(London\))?|\.co\.uk|\.com)|thisislondon(?:\.co\.uk|\.com|))", "$1$2Evening Standard|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Evening Standard", "work$2$3Evening Standard");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:Financial Times(?: \(London\)|))|(?:FT|Financial Times)(?:\.com|))\b(?:\|[^\]]+|)(\]\])", "$1$2$3Financial Times$4|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:Financial Times(?: \(London\)|))|(?:FT|Financial Times)(?:\.com|))\b", "$1$2Financial Times|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Financial Times", "work$2$3Financial Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[|)ITV News(\]\]|)", "publisher$1$2ITV News$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Irish ?Independent|Independent Newspapers \(?Ireland\)?|Independent\.ie)(?:\|[^\]]+|)(\]\])", "$1$2$3Irish Independent$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Irish ?Independent|Independent Newspapers \(?Ireland\)?|Independent\.ie)", "$1$2Irish Independent");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)Irish Independent", "work$2$3Irish Independent");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|via|website|work)(\s*=\s*)(\[\[|)legislation\.gov\.uk(\]\]|)", "publisher$1$2legislation.gov.uk$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)''(\[\[|)legislation\.gov\.uk(\]\]|)''", "$1legislation.gov.uk$2"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:parliament\.uk|Parliament of the United Kingdom)(?:\|[^\]]+|)(\]\])", "publisher$2$3Parliament of the United Kingdom$4"); //668
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:parliament\.uk|Parliament of the United Kingdom)", "publisher$2Parliament of the United Kingdom"); //679
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[)(?:(?:The |)(?:Daily |)Telegraph)(?:\.co\.uk|)(?:\|[^\]]+)(?:\]\])", "$1$2The Daily Telegraph"); // 20,784
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:The |)(?:Daily |)Telegraph)(?:\.co\.uk|)(\]\])", "$1$2The Daily Telegraph");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:telegraph\.co\.uk|(?:The |)Daily Telegraph)(?! \(Sydney\))", "$1$2The Daily Telegraph"); //v
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Daily Telegraph", "work$2$3The Daily Telegraph");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[)(?:The ?|)Guardian(?:\.com|\.co\.uk| News(?:paper| and media|)| Unlimited| UK|)(?:\|[^\]]+|)(?:\]\])", "$1$2The Guardian");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The ?|\w+\.|)Guardian(?:\.com|\.co\.uk| News(?:paper| and media|)| Unlimited| UK|)", "$1$2The Guardian"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Guardian", "work$2$3The Guardian");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)Independent\.co\.uk(?:\]\]|)", "$1$2The Independent|location=London"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?<!\w )(?:The |)Independent(?: \(?(?:london(?: \(UK\)|)|newspaper|UK(?: newspaper|)|Online)\)?|)(?!\.)(?:\|[^\]]+)(\]\])", "$1$2The Independent");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)The Independent(\]\])", "$1$2The Independent"); //unlink only
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?<!\w )(?:The Independent(?: \(?(?:London \(?UK\)?|London|UK)\))|Independent \(?UK(?: newspaper|)\)?)(?!\.)", "$1$2The Independent");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Independent", "work$2$3The Independent");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)(?:(?:Rai?di[óo] |)Tei?l[ei]f[íi]s [EÉ]ireann|RT[EÉ])(?:\.ie|)(?:\|[^\]]+|)(\]\])", "publisher$2$3RTÉ$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(?:(?:Rai?di[óo] |)Tei?l[ei]f[íi]s [EÉ]ireann|RT[EÉ])(?:\.ie|)", "publisher$2RTÉ");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)RT[EÉ] News(?:\|[^\]]+|)(\]\])", "publisher$2$3RTÉ News$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)RT[EÉ] News", "publisher$2RTÉ News");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:sky ?news(?:\.com|\.co\.uk| channel| online| international| UK|)|news\.sky\.com)(?:\|[^\]]+|)(\]\])", "publisher$2$3Sky News$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:sky ?news(?:\.com|\.co\.uk| channel| online| international| UK|)|news\.sky\.com)(?=\s*[\|\}])", "publisher$2Sky News");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |)Irish ?Times(?:\.com|)(?:\|[^\]]+|)(\]\])", "$1$2$3The Irish Times$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The |)Irish ?Times(?:\.com|)", "$1$2The Irish Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*=\s*)(\[\[|)The Irish Times", "work$2$3The Irish Times");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The |news\.|)Scotsman(?:\.com| \(?newspaper\)?|)(?:\|[^\]]+|)(\]\])", "$1$2$3The Scotsman$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\w+\.|The |)Scotsman(?:\.com| \(?newspaper\)?|)", "$1$2The Scotsman");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)The Scotsman", "work$2$3The Scotsman");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:the|)Timesonline\.co(?:\.uk|m)|(?:the ?|)Times ?on-?line)(?:\|[^\]]+|)(\]\])", "$1$2$3The Times$4|location=London"); // 210
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Thetimes\.co\.uk", "$1$2The Times|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:The ?Times(?:\.co\.uk|\.com| \(?(?:digital archive|newspaper|of London|UK|London(?:, England|)|online|United Kingdom)\)?)|(?:The |)London Times)(?:\|[^\]]+|)(\]\])", "$1$2The Times|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:The ?Times(?:\.co\.uk|\.com| \(?(?:digital archive|newspaper|of London|UK|London(?:, England|)|online|United Kingdom)\)?)|(?:The |)London Times)", "$1$2The Times|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Times(?:\.co\.uk|\.com| \(?(?:digital archive|newspaper|of London|UK|London(?:, England|)|online|United Kingdom)\)?)|(?:\w+\.|)timesonline(?:\.co\.uk|))(?:\|[^\]]+|)(\]\])", "$1$2The Times|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Times(?:\.co\.uk|\.com| \(?(?:digital archive|newspaper|of London|UK|London(?:, England|)|online|United Kingdom)\)?)|(?:\w+\.|)timesonline(?:\.co\.uk|))", "$1$2The Times|location=London");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|last|publisher|via)(\s*\=\s*)(\[\[|)The Times\|location=London", "work$2$3The Times|location=London");
 // publisher → work
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s*)publisher(\s*=\s*(?:\[\[|)(?:Blick|CounterPunch|Empire|Hamburger Morgenpost|Kerrang|Mixmag|Mojo|))(?:\.com|\.co\.uk|) ?(?=[\]|}\n])", "$1work$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s*)publisher(\s*=\s*(?:\[\[|)(?:The ?|)(?:\w+ |)*(?:Christian Science Monitor|Economist|Gazette|Herald|Independent|Mail|Mirror|Post|Standard|Star|Telegraph|Times))(?:\.com|\.co\.uk|) ?(?=[\]|}\n])", "$1work$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[|)(The |)(Academy|College|School|University) of ([^\]}|]+)(\]\]|)", "publisher$2$3$4$5 of $6$7"); // (1 of 3) 36230
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|journal|magazine|newspaper|periodical|via|website|work)(\s*=\s*)(.{2,28})(College|School|University)(\s*[\|\}])", "publisher$1$2$3$4"); //26509
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|journal|magazine|newspaper|periodical|via|website|work)(\s*=\s*)(.{2,28})(Association|Cent[er][er]|Council|Institute|League|Programm?e?|Society|Trust)(?! \w)(\s*[\|\}])", "publisher$1$2$3$4"); //37854 unlinked only
 // link maintenance
 //ArticleText=Regex.Replace(ArticleText, @"(?i)(url\s*=\s*https:\/\/w{3}\.academia\.edu\/\d{8})\/[^\s\|\]]+", "$1"); 
 //Asia
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(Sui|Liao|Song|Tang|Yuan) Dynasty\|([^\]]+)(\]\])", "$1$2 dynasty|$3$4"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(Sui|Liao|Song|Tang|Yuan) Dynasty(\]\])", "$1$2 dynasty$3"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:The |)(?:People['’]s Republic of|PR) China\|([^\]]+)(\]\])", "$1China|$2$3"); //5773
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(The |)(People['’]s Republic of|PR) China(\]\])", "$2$3 $1China$4"); //9421
 //City State
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Atlanta(?:, Georgia|, GA|, USA?|, United States)\|([^\]]+)(\]\])", "$1Atlanta|$2$3"); //11,388
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Atlanta(, Georgia|, GA|, USA?|, United States)(\]\])", "$1Atlanta$3$2"); //11,388
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Baltimore, Maryland\|([^\]]+)(\]\])", "$1Baltimore|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Baltimore, Maryland(\]\])", "$1Baltimore$2, Maryland"); //(9,278)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Boston, Massachusetts\|([^\]]+)(\]\])", "$1Boston|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Boston, Massachusetts(\]\])", "$1Boston$2, Massachusetts"); //12087
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Brooklyn(:, New York CIty|, New York|, NY|, United States)(\]\])", "$1Brooklyn$3$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Brooklyn(?:, New York CIty|, New York|, NY|, United States)\|([^\]]+)(\]\])", "$1Brooklyn|$2$3"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Chicago, (?:Illinois|United States)\|([^\]]+)(\]\])", "$1Chicago|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Chicago, (Illinois|United States)(\]\])", "$1Chicago$3, $2"); //14,330
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Cincinnati, Ohio\|([^\]]+)(\]\])", "$1Cincinnati|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Cincinnati, Ohio(\]\])", "$1Cincinnati$2, Ohio"); //(5,095)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Cleveland, Ohio\|([^\]]+)(\]\])", "$1Cleveland|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Cleveland, Ohio(\]\])", "$1Cleveland$2, Ohio"); //(7,585)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Damascus, Syria(\]\])", "$1Damascus$2, Syria"); // (2024-09-28, 128)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Denver, Colorado\|([^\]]+)(\]\])", "$1Denver|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Denver, Colorado(\]\])", "$1Denver$2, Colorado"); //(6,000)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Houston(?:, Texas|, TX|, USA?|, United States)\|([^\]]+)(\]\])", "$1Houston|$2$3"); //(9,361)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Houston(, Texas|, TX|, USA?|, United States)(\]\])", "$1Houston$3$2"); //(9,361)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Los Angeles, (?:California|CA|USA|United States)(\|[^\]]+)(\]\])", "$1Los Angeles|$2$3"); //3691
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Los Angeles, (California|CA|USA|United States)(\]\])", "$1Los Angeles$3, $2"); //16234
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Minneapolis, Minnesota(\]\])", "$1Minneapolis$2, Minnesota"); //(5,261)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)New Orleans, Louisiana(\]\])", "$1New Orleans$2, Louisiana"); //(6,700)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)New York City(, New York, (?:USA|United States)|, (?:United States|USA|NY|New York))(\]\])", "$1New York City$3$2"); //(3,917)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Nantucket, Massachusetts\|([^\]]+)(\]\])", "$1Nantucket|$2$3"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Nantucket, Massachusetts(\]\])", "$Nantucket$2, Massachusetts"); //620
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Nagoya(?:, Japan| City|, Aichi Prefecture|, Aichi)\|([^\]]+)(\]\])", "$1Nagoya|$2$3"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Nagoya(, Japan| City|, Aichi Prefecture|, Aichi)(\]\])", "$1Nagoya$3$2"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Noum[eé]a(?:, New Caledonia|)\|([^\]]+)(\]\])", "$1Nouméa|$2$3"); // (2024-09-27, 50)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Noum[eé]a, New Caledonia(\]\])", "$1Nouméa$2, New Caledonia"); // (2024-09-27, 61)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Noumea(\]\])", "$1Nouméa$2"); // (2024-09-27, 315) 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Nuku(?:’|'|‘|`| |)alofa(\]\])", "$1Nukuʻalofa$2"); //(2024-09-27, 248)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)San Diego, California\|([^\]]+)(\]\])", "$1San Diego|$2$3"); //2054
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)San Diego, California(\]\])", "$1San Diego$2, California"); //8016
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)San Pedro, (?:California|Los Angeles)(?:, California|)(\]\])", "$1San Pedro, Los Angeles$2"); //1293
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Seattle, Washington\|([^\]]+)(\]\])", "$1Seattle|$2$3"); //1302
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Seattle, Washington(\]\])", "$1Seattle$2, Washington"); //6438
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Southend on Sea(\]\])", "$1Southend-on-Sea$2"); //55
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Sunderland, Tyne and Wear(\]\])", "$1Sunderland$2, Tyne and Wear"); //1,357
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Valparaiso(\]\])", "$1Valparaíso$2"); //534
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Wilmington, California(\]\])", "$1Wilmington, Los Angeles$2"); //237
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Yokohama, (?:Kanagawa|Japan)\|([^\]]+)(\]\])", "$1Yokohama|$2$3"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Yokohama, (Kanagawa|Japan)(\]\])", "$1Yokohama$3, $2"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Z[uü]rich, Switzerland(\]\])", "$1Zürich$2, Switzerland"); //590
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Z[uü]rich, Switzerland\|([^\]]+)(\]\])", "$1Zürich|$2$3"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Zürich\|([^\]]+)(\]\])", "$1Zurich|$2$3"); //605
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Zürich(\]\])", "$1Zurich$2"); //9725
 //Eastern Europe
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Russian Revolution of 1917\|([^\]]+)(\]\])", "$1Russian Revolution|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Russian Revolution of 1917(\]\])", "$1Russian Revolution$2 of 1917");
 //Entertainment
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:The |)Official(?: UK | |)Charts?(?:\.com| Company|)\|([^\]]+)(\]\])", "$1Official Charts Company|$2$3"); //rs
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:The |)Official(?: UK | |)Charts?(?:\.com| Company|)(\]\])", "$1Official Charts Company$2"); //rs
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Syndicat National de l'[EÉ]dition Phonographique\|([^\]]+)(\]\])", "$1SNEP|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Syndicat National de l'[EÉ]dition Phonographique(\]\])", "$1SNEP$2");
 //Military
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Asiatic-Pacific Campaign Medal(\]\])", "$1Asiatic–Pacific Campaign Medal$2"); //1,681
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Maritime Commission(\]\])", "$1United States Maritime Commission$2"); //1,768
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Mentioned in Despatches(\]\])", "$1Mentioned in dispatches$2"); //1947
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:WW|World War) ?(?:1|I|One)(\]\])", "$1World War I$2"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:WW|World War) ?(?:2|II|Two)(\]\])", "$1World War II$2"); 
 //Sports
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Australian Rules Football(\]\])", "$1Australian rules football$2"); //509
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Midfield(?:er|) \((?:(?:association |)football|soccer)\)\|([^\]]+)(\]\])", "$1Midfielder|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(Midfielder)\|(\w+) \2(\]\])", "$3 $1midfielder$4"); //1828
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:''|)(\[\[|)Rugby ?League ?Project(?:\.org|)(\]\]|)(?:''|)", "$1Rugby League Project$2");
 //United States
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:Associated Press News|The Associated Press)\|([^\]]+)(\]\])", "$1Associated Press|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)The Associated Press(\]\])", "the $1Associated Press$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Associated Press News(\]\])", "$1Associated Press$2 News");//567
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Amazon\.com(\|[^\]]+|)(\]\])", "$1Amazon (company)|Amazon$3"); //8.960
ArticleText=Regex.Replace(ArticleText, @"(?i)Amazon(?:\.com|\.co\.uk)", "Amazon");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)James River[, ] ?\(?Virginia\)?\|([^\]]+)(\]\])", "$1James River|$2$3"); //732
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)James River, Virginia(\]\])", "$1James River$2, Virginia"); //89
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Salvation Army\|([^\]]+)(\]\])", "$1The Salvation Army|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Salvation Army(\]\])", "$1The Salvation Army$2"); //1,911
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:\[\[)(?:USA|United States(?: of America|))\|([^\]]+)(?:\]\])", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:\[\[)(United States)( of America|)(?:\]\])", "$1$2"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)U\.?S\.? Army(\]\])", "$1United States Army$2"); //v
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)U\.?S\.? Army Reserve(\]\])", "$1United States Army Reserve$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)U\.?S\.? Marine Corps Reserve(\]\])", "$1United States Marine Corps Reserve$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)U\.?S\.? Navy(\]\])", "$1United States Navy$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)U\.?S\.? Air Force(\]\])", "$1United States Air Force$2"); //v
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)U\.?S\.? Coast Guard(\]\])", "$1United States Coast Guard$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)U\.?S\.? Marines(\]\])", "$1United States Marines$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:(?:West|Pacific) Coast of the United States|(?:American|United States|U\.?S\.?) West Coast)(\]\])", "$1West Coast of the United States$2"); //650
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Yahoo!( \w+|)( \w+|)(\]\])", "$1Yahoo$2$3$4"); //14697
 //Western Europe
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Acad[eé]mie fran[cç]aise(\]\])", "$1Académie Française$2"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)British Broadcasting Corporation\|([^\]]+)(\]\])", "$1BBC|$2$3"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)British Railways\|([^\]]+)(\]\])", "$1British Rail|$2$3"); //1970
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:British|Honourable) East India Company\|([^\]]+)(\]\])", "$1East India Company|$2$3"); //398
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)East India Company\|British East India Company(\]\])", "British $1East India Company$2"); //291
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Civil parish(?:es (?:in|of) (?:Britain|England)| \(England\)|es|)\|([^\]]+)(\]\])", "$1Civil parish|$2$3"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Civil parishes (in|of) England(\]\])", "$1Civil parish$3es $2 England");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Coronation of Queen Elizabeth II(\]\])", "$1Coronation of Elizabeth II$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Dissolution of the Monasteries\|([^\]]+)(\]\])", "$1Dissolution of the monasteries|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Dissolution of the Monasteries(\]\])", "$1dissolution of the monasteries$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:Easter Sunday|Easter\|Easter Sunday)(\]\])", "$1Easter$2 Sunday");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:Queen |)Elizabeth I(?: of England|)\|([^\]]+)(\]\])", "$1Elizabeth I|$2$3"); //3393
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Elizabeth I of England(\]\])", "$1Elizabeth I$2 of England"); //979
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Queen Elizabeth I of England(\]\])", "Queen $1Elizabeth I$2 of England"); //101
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Elizabeth I\|Queen Elizabeth I(\]\])", "Queen $1Elizabeth I$2"); //86
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(\[\[)(HM Queen |Her Majesty Queen |Queen )Elizabeth II(\]\])", "$2 $1Elizabeth II$3"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Elizabeth II of the United Kingdom(\]\])", "$1Elizabeth II$2 of the United Kingdom"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:HM |Her Majesty |)(?:Queen |)(Elizabeth II)(?: of the United Kingdom|)\|(.*?|)\2([^\]]{1,25}|)(\]\])", "$3$1$2$5$4"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:HM |Her Majesty |)(?:Queen |)Elizabeth II(?: of the United Kingdom|)\|([^\]]+)(\]\])", "$1Elizabeth II|$2$3"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)First French Republic(\]\])", "$1French First Republic$2"); //778
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King George I of Great Britain|George I of (?:Great Britain(?: and Ireland)|the United Kingdom))\|([^\]]+)(\]\])", "$1George I of Great Britain|$2$3"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King |)George III of(?: the United Kingdom| Great Britain)\|([^\]]+)(\]\])", "$1George III|$2$3"); //2269 2351
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King |)George III of( the United Kingdom| Great Britain)(\]\])", "$1George III$3 $2"); //314 362
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)George III\|King George III(\]\])", "King $1George III$2"); //185
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)George IV of the United Kingdom\|([^\]]+)(\]\])", "$1George IV|$2$3"); //1593
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)George IV of the United Kingdom(\]\])", "$1George IV$2 of the United Kingdom"); //123
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)George IV\|King George IV(\]\])", "King $1George IV$2"); //38
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:(?:King |)Edward VI(?: of England)|King Edward VI)\|([^\]]+)(\]\])", "$1Edward VI|$2$3"); //1048
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Edward VI\|King Edward VI(\]\])", "King $1Edward VI$2"); //7
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)King Edward VII(\]\])", "King $1Edward VII$2"); //#1 1 of 2 (2024-09-06, 674)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Edward VII of the United Kingdom(\]\])", "$1Edward VII$2 of the United Kingdom"); //#1 2 of 2 (2024-09-06, 116)
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:King |)(Edward VII)(?: of the United Kingdom|)\|(.*?|)\1([^\]]{1,25}|)\]\]", "$2[[$1]]$3"); //#B 2L Edward VII after pipe
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King |)Edward VII(?: of the United Kingdom|)\|([^\]]+)(\]\])", "$1Edward VII|$2$3"); //#B 2L everything else
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King Edward VIII|Edward VIII of the United Kingdom|Edward, Duke of Windsor)\|([^\]]+)(\]\])", "$1Edward VIII|$2$3"); //413
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Edward VIII of the United Kingdom(\]\])", "$1Edward VIII$2 of the United Kingdom"); //39
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Edward VIII\|King Edward VIII(\]\])", "King $1Edward VIII$2"); //119
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King George V(?: of the United Kingdom|)|George V of the United Kingdom)\|([^\]]+)(\]\])", "$1George V|$2$3"); //2057
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(King |)George V of the United Kingdom(\]\])", "$1$2George V$3 the United Kingdom"); //135
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)George V\|King George V(\]\])", "King $1George V$2"); //654
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:George VI of the United Kingdom|King George VI)\|([^\]]+)(\]\])", "$1George VI|$2$3"); //810
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)King George VI(\]\])", "King $1George VI$2"); //855
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)George VI of the United Kingdom(\]\])", "$1George VI$2 of the United Kingdom"); //71
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)George VI\|King George VI(\]\])", "King $1George VI$2"); //552
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King |)Henry VIII(?: of England|)\|([^\]]+)(\]\])", "$1Henry VIII|$2$3"); // (3624)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)King Henry VIII(\]\])", "King $1Henry VIII$2"); // (284)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Henry VIII of England(\]\])", "$1Henry VIII$2 of England"); // (890)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Henry VIII\|(King |)Henry VIII( of England|)(\]\])", "$2$1Henry VIII$4$3"); // (125)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)James I of England\|([^\]]+)(\]\])", "$1James VI and I|$2$3"); //1,794
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:Légion d'honneur|Legion of Honor)(\]\])", "$1Legion of Honour$2"); //2506
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King Louis XIII|Louis XIII of France)\|([^\]]+)(\]\])", "$1Louis XIII|$2$3"); //573
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King William IV|William IV of the United Kingdom)\|([^\]]+)(\]\])", "$1William IV|$2$3"); //1,174
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)William IV of the United Kingdom(\]\])", "$1William IV$2  of the United Kingdom"); //(107)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)William IV\|King William IV(\]\])", "King $1William IV$2"); //(31)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Louis XIII of France(\]\])", "$1Louis XIII$2 of France"); //398
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:King Louis XIV(?: of France|)|Louis XIV of France)\|([^\]]+)(\]\])", "$1Louis XIV|$2$3"); //1812
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Louis XIV\|King Louis XIV(\]\])", "King $1Louis XIV$2"); //37
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Louis XIV\|Louis XIV of France(\]\])", "$1Louis XIV$2 of France"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Louis XIV of France(\]\])", "$1Louis XIV$2 of France"); //1158
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:King |)(Louis XV)(?: of France|)\|(.*?|)\1([^\]]{1,25}|)\]\]", "$2[[$1]]$3"); //2L (2024-09-23, 725)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Louis XV of France(\]\])", "$1Louis XV$2 of France"); //1 of 2 (2024-09-23, 496)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)King Louis XV(\]\])", "King $1Louis XV$2"); //2 of 2 (2024-09-23, 91)
ArticleText=Regex.Replace(ArticleText, @"(?i)\[\[(?:King |)(Louis XVI)(?: of France|)\|(.*?|)\1([^\]]{1,25}|)\]\]", "$2[[$1]]$3"); //2L (2024-09-22, 1544)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Louis XVI of France(\]\])", "$1Louis XVI$2 of France"); //1 of 2 (2024-09-23, 305)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)King Louis XVI(\]\])", "King $1Louis XVI$2"); //2 of 2 (2024-09-23, 132)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:Emperor |)Napol[eé][oó]ne?(?: Bon[ae]parte| I(?: of France|, Emperor of the French|)|)\|([^\]]+)(\]\])", "$1Napoleon|$2$3"); //sc
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Napoleon\|Napol[eé][oó]ne?( Bonaparte)(\]\])", "$1Napoleon$2$3"); //607
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Napoleon( Bonaparte|I of France)(\]\])", "$1Napoleon$3$2"); //2233
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:Queen Elizabeth I(?: of England|)|Elizabeth I of England)\|([^\]]+)(\]\])", "$1Elizabeth I|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Queen Elizabeth I(\]\])", "Queen $1Elizabeth I$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:Queen |)Victoria(?:, Queen|) of the United Kingdom\|([^\]]+)(\]\])", "$1Queen Victoria|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Queen Victoria of the United Kingdom(\]\])", "$1Queen Victoria$2 of the United Kingdom");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:UK|United Kingdom) census,? (\d{4})(\]\])", "$1$2 United Kingdom census$3"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:UK|United Kingdom) census,? (\d{4})\|([^\]]+)(\]\])", "$1$2 United Kingdom census|$3$4"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(\d{4}) (?:UK|United Kingdom) census(\]\])", "$1$2 United Kingdom census$3"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(\d{4}) (?:UK|United Kingdom) census\|([^\]]+)(\]\])", "$1$2 United Kingdom census|$3$4"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:UK|United Kingdom) (\d{4}) census(\]\])", "$1$2 United Kingdom census$2"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)(?:UK|United Kingdom) (\d{4}) census\|([^\]]+)(\]\])", "$1$2 United Kingdom census|$3$4"); //F
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)University College, London(\]\])", "$1University College London$2"); //953
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Member of Parliament\|([^\]]+)(\]\])", "$1Member of parliament|$2$3"); //11,747
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Protestant Reformation\|([^\]]+)(\]\])", "$1Reformation|$2$3"); //
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Protestant Reformation(\]\])", "Protestant $1Reformation$2"); //4621
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Roman Catholic Church(\]\])", "Roman $1Catholic Church$2"); //17,277
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Royal Charter(\]\])", "$1royal charter$2");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Old English language\|([^\]]+)(\]\])", "$1Old English|$2$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Old English language(\]\])", "$1Old English$2 language"); //1,353
ArticleText=Regex.Replace(ArticleText, @"(?i)the (''|)(\[\[)London Gazette(\]\])(''|)", "$1$2The London Gazette$3$4"); //1,397
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Kingdom of Spain\|([^\]]+)(\]\])", "$1Spain|$2$3"); //1,174
ArticleText=Regex.Replace(ArticleText, @"(?i)(\[\[)Kingdom of Spain(\]\])", "Kingdom of $1Spain$2"); //(107)
ArticleText=Regex.Replace(ArticleText, @"(?i)the (\[\[)Bahamas(\]\])", "$1the Bahamas$2"); //(2505)
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[|)Plos ?(?:1|One)(\]\]|)", "$1$2$3PLOS One$4"); //11,437
 // Undefined hybrid
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:British Army|army\.mod\.uk)(?:\|[^\]]+|)(\]\])", "publisher$2$3British Army$4"); //62
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:British Army|army\.mod\.uk)", "publisher$2British Army"); //407
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(\[\[)(?:National Army Museum|nam\.ac\.uk)(?:\|[^\]]+|)(\]\])", "publisher$2$3National Army Museum$4"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*\=\s*)(?:National Army Museum|nam\.ac\.uk)", "publisher$2National Army Museum"); 
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:United States|U\.? ?S\.?) ?Army|army\.mil)(?:\|[^\]]+|)(\]\])", "publisher$2$3United States Army$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:United States|U\.? ?S\.?) ?Army|(?:\w+\.|)army\.mil)", "publisher$2United States Army");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:United States|U\.? ?S\.?|) Navy|(?:\w+\.|)navy\.mil)(?:\|[^\]]+|)(\]\])", "publisher$2$3United States Navy$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)\b(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:United States|U\.? ?S\.?|) Navy|(?:\w+\.|)navy\.mil)", "publisher$2United States Navy");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:United States|U\.? ?S\.?|) Air Force|USAF|(?:\w+\.|)af\.mil)(?:\|[^\]]+|)(\]\])", "publisher$2$3United States Air Force$4");
ArticleText=Regex.Replace(ArticleText, @"(?i)(agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)\b(?:(?:United States|U\.? ?S\.?|) Air Force|USAF|(?:\w+\.|)af\.mil)", "publisher$2United States Air Force");
 // Self publishers Trove
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)Academia\.edu(?:\]\]|)", "via$1Academia.edu");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)(?:The |)British ?Newspaper ?Archive(?:\.co\.uk|)(?:\]\]|)", "via$1British Newspaper Archive");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)youtube(?:\.com|)(?:\|[^\]]+|)(\]\])", "via$1YouTube"); //2024-10-16, 68
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)youtube(?:\.com|)", "via$1YouTube");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)facebook(?:\.com|)(?:\|[^\]]+|)(\]\])", "via$1Facebook");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)facebook(?:\.com|)", "via$1Facebook");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)find ?articles(?:\.com|)(?:\]\]|)", "via$1FindArticles");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)(?:(?:Project |)Gutenberg(?: of|) Australia|gutenberg\.net\.au)(?:\]\]|)", "via$1Project Gutenberg Australia");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:Project |)Gutenberg(?:\.org|)(?:\|[^\]]+|)(\]\])", "via$1$2Project Gutenberg$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:Project |)Gutenberg(?:\.org|)", "via$1Project Gutenberg");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)highbeam(?:\.com| research| business|)(?:\|[^\]]+|)(\]\])", "via$1$2HighBeam Research$3");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)highbeam(?:\.com| research| business|)", "via$1HighBeam Research");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)imgur(?:\.com|)(?:\]\]|)", "via$1Imgur");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)instagram(?:\.com|)(?:\]\]|)", "via$1Instagram");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)LinkedIn(?:\.com|)(?:\]\]|)", "via$1LinkedIn");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[)(?:(?:The |)Internet ?Archives?(?! \w)|(?<!\.)archive\.org)(?:\|[^\]]+|)(?:\]\])", "via$1Internet Archive");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:The |)Internet ?Archives?(?! Wayback Machine)|(?<!web\.)(?<!wayback\.)(?:web\.|)archive\.org)", "via$1Internet Archive");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)(?:National Library of Australia|Australian National LIbrary|(?:catalogue\.|)nla\.gov\.au)(?:\]\]|)", "via$1National Library of Australia");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)Newspapers\.com(?:\]\]|)", "via$1Newspapers.com");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)(?:press ?reader|newspaper ?direct(?: Inc\.|))(?:\.com|)(?:\]\]|)", "via$1Press Reader");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)Pro ?Quest(?:\.com|)(?:\]\]|)", "via$1ProQuest");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Scribd(?:\.com|)", "via$1Scribd");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)Trove(?:\.nla\.gov\.au|)(?:\|[^\]]+|)(\]\])", "via$1Trove");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Trove(?:\.nla\.gov\.au|)", "via$1Trove");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)twi?tte?r(?:\.com|Inc\.?|)(?:\|[^\]]+|)(\]\])", "via$1Twitter");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)twi?tte?r(?:\.com|Inc\.?|)", "via$1Twitter");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)Tumblr(?:\.com|)", "via$1Tumblr");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(\[\[)(?:(?:Internet |)(?:Archive |The |)Wayback Machine|web\.archive\.org)(?:\|[^\]]+|)(\]\])", "via$1Wayback Machine");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:(?:Internet |)(?:Archive |The |)Wayback Machine|web\.archive\.org)", "via$1Wayback Machine");
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:agency|author|first|journal|last|magazine|newspaper|periodical|publisher|via|website|work)(\s*=\s*)(?:\[\[|)vimeo(?:\.com|)(?:\]\]|)", "via$1Vimeo");
 // RemoveTemplateParameter
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "infobox football club season", "conference result"); //845
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "infobox football club season", "ceo"); //845
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "infobox football club season", "conference"); //845
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "infobox football club season", "ceotitle"); //845
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "infobox military person", "residence"); //439
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "infobox military person", "nationality"); //439
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "infobox sportsperson", "residence"); //2838
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "Infobox rugby league biography", "nickname"); //308
ArticleText = WikiFunctions.Tools.RemoveTemplateParameter(ArticleText, "Infobox musical artist", "associated_acts"); //39,637
 // Minor formatting
ArticleText=Regex.Replace(ArticleText, @"(?i)League A\s?(?:‑+|-+|-|−|–|—|&ndash;|&mdash;)\s?Z Player", "League A–Z Player");
ArticleText=Regex.Replace(ArticleText, @"(?i)\|\s?pages\s?=\s?(\d{1,4})–\}\}", "|page=$1}}"); //Google Books "pages" 25049
 // rem unnecessary quote marks
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?title\s*\=\s*)['‘]([^\|'’]+)['’](?=\s?[\|\}])", "$1$2");
 // removing blank parameters
ArticleText=Regex.Replace(ArticleText, @"(?i)(?:\|[ ]*(?:access-?date|agency|archive-?(?:date|url)|arxiv|asin|at|author(-?link|-mask|-name-separator|-separator|\d|\d-link|link\d?|)|bibcode|chapter|chapter(?:url|-url)|coauthors|contribution(?:-url|)|date|deadurl|df|display-authors|doi|doi-inactive|doibroken|edition|editor(?:-first|-last|-link|\d|\d-first|\d-last|\d-link|)|(?:first|last)\d?|format|id|is[bs]n|issue|jfm|journal|jstor|language|lay(?:date|source|summary)|lccn|location|magazine|month|mr|newspaper|nopp|oclc|ol|origyear|osti|others|pages?|periodical|place|pm[cd]|pmid|postscript|publication(?:-date|-place)|publisher|quote|ref|rfc|separator|series|ssrn|trans_title|type|url|via|volume|website|work|year|zbl)[ ]*=[\s]*)(?=[\}\|])", "");
 //rem redundant top-level domains (.com, .net, .org)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|\s?(?:journal|newspaper|periodical|publisher|work)\s*\=\s*)(\[\[[^\[\]\}]*\]\])\.(?:biz|com|net|org|co\.uk)(?=\s*[\|\}])", "$1$2");
 //rem duplicated publishers in separate fields (pre)
ArticleText=Regex.Replace(ArticleText, @"(?i)[‒–—―]+\s*([^\|\}]{3,})\s*(\|\s?(?:publisher|work)\s*\=\s*(?:\w+\.|))\1(?=\s[\|\}])", "$2$1");
 //'work' and its alias (pre)
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*?newspaper[ ]*=[^\|]*(?:\|[^\{\}]*|))(?:\|[ ]*?work[ ]*=[^\|\}]*)(?=[\|\}])+", "$1");
 // eliminating time of day
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*author[ ]*=[ ]*)(?:posted|published)(?: by| on|)[\s:](?=\s*\w)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*author[ ]*=[ ]*)[123]?\d (Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?) (?:(?:18|19|20|\d)\d{2})(?: at| on)", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*author[ ]*=[ ]*)[123]?\d (Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?) (?:(?:18|19|20|\d)\d{2})", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate|author)[ ]*=[ ]*)[0-2]?\d:[0-5]\d(?:[ ]|&nbsp;)(?:[ap]m ?|[ap]\.m\. |[A-Z]{1,2}T|UTC)[\.,]?[ ]?", "$1");
 // eliminating days of the week
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate|author)[ ]*=[ ]*)(?:(?:Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day,?)\s", "$1");
ArticleText=Regex.Replace(ArticleText, @"(?i)(\|[ ]*(?:date|archivedate|accessdate|author)[ ]*=[ ]*)(?:(?:Mon|Tues?|Wed|Thur?|Fri|Sat|Sun)[\.,]?)\s", "$1");

return ht.AddBack(ArticleText);

return ArticleText;
}