//Script originally by [[User:Lightmouse]]
//Original version is available at [[User:Lightmouse/javascript conversion]]
public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
Skip = false;
Summary = "";
//Identify surprise or 'Easter egg' diversions linking years to 'year in something' articles. Turn them into year links to be dealt with below
//removed
// century
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[((?:first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|twenty(?: |-)first)(?: |-))century\]\]", "$1century");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[((?:first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth|twentieth|twenty(?: |-)first)(?: |-))century (AD|BC|CE|BCE)\]\]", "$1century");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,2}(?:st|nd|rd|th)(?: |-))century\]\]", "$1century");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,2}(?:st|nd|rd|th)(?: |-))centuries\]\]", "$1centuries");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2}(?:st|nd|rd|th)(?: |-)century\|(\d{1,2}(?:st|nd|rd|th))\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2}(?:st|nd|rd|th)(?: |-)century\|(\d{1,2}(?:st|nd|rd|th)(?: |-))century\]\]", "$1century");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2}(?:st|nd|rd|th)(?: |-)century\|(\d{1,2}(?:st|nd|rd|th)(?: |-))centuries\]\]", "$1centuries");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,2}(?:st|nd|rd|th)(?: |-))century (AD|BC|CE|BCE)\]\]", "$1century $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2}(?:st|nd|rd|th)(?: |-)century\|(\d{1,2}(?:st|nd|rd|th)(?: |-))century (AD|BC|CE|BCE)\]\]", "$1century $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2}(?:st|nd|rd|th)(?: |-)century\|(\d{1,2}(?:st|nd|rd|th)(?: |-))centuries (AD|BC|CE|BCE)\]\]", "$1centuries $2");
// decades and years
ArticleText = Regex.Replace(ArticleText, @"\[\[(\d{1,4})\'?s\]\]", "$1s");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,4})\'?(s)? ?(AD|BC|CE|BCE)\]\]", "$1$2 $3");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4}\'?s? ?(?:AD|BC|CE|BCE)\|(\d{1,4})\'?(s)?\]\]", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4}\'?s? ?(?:AD|BC|CE|BCE)\|(\d{1,4})\'?(s)? ?(AD|BC|CE|BCE)\]\]", "$1$2 $3");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4}\'?s?\|(\d{1,4})\'?(s)? ?(AD|BC|CE|BCE)\]\]", "$1$2 $3");
ArticleText = Regex.Replace(ArticleText, @"\[\[\d{1,4}\'?s?\|(\d{1,4})\'?(s)?\]\]", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d\d?(?:st|nd|rd|th) centur(?:y|ies)\|(\d{1,4})\'?(s)?\]\]", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\w{5,12} centur(?:y|ies)\|(\d{1,4})\'?(s)?\]\]", "$1$2");
// solitary day_numbers
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2}(?:st|nd|rd|th))\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2} (?:January|February|March|April|May|June|July|August|September|October|November|December)\|(\d{1,2}(?:st|nd|rd|th))\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,2}(?:st|nd|rd|th))\]\]", "$1");
//month+day: removed.
//Identify surprise or 'Easter egg' diversions linking month+years to year articles. Turn them into month+year links to be dealt with below
//removed
//Month+day_number "March 7th" -> "March 7"
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(January|February|March|April|May|June|July|August|September|October|November|December) (\d?\d)(?:st|nd|rd|th)\]\]", "[[$1 $2]]");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December) \d?\d)\]\](?:st|nd|rd|th)", "[[$1]]");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d?\d)(?:st|nd|rd|th) (January|February|March|April|May|June|July|August|September|October|November|December)\]\]", "[[$1 $2]]");
//Month + year
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December) \d{3,4})\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{3,4} (?:January|February|March|April|May|June|July|August|September|October|November|December))\]\]", "$1");
//remove piped years
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4} in .{1,30}\|(\d{1,4})\]\]", "[[$1]]");
//remove piped years from full dates
// ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[\d\d? (?:January|February|March|April|May|June|July|August|September|October|November|December)\]\],? ? ?)\[\[.{1,30}\|(\d{1,4})\]\]", "$1[[$2]]");
// ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[\d\d? (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\]\],? ? ?)\[\[.{1,30}\|(\d{1,4})\]\]", "$1[[$2]]");
// ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d\d?\]\],? ? ?)\[\[.{1,30}\|(\d{1,4})\]\]", "$1[[$2]]");
// ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d\d?\]\],? ? ?)\[\[.{1,30}\|(\d{1,4})\]\]", "$1[[$2]]");
// ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[.{1,30}\|(\d{1,4})\]\](,? ?\-? ?\[\[(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d\d?\]\])", "[[$1]]$2");
// ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[.{1,30}\|(\d{1,4})\]\](,? ?\-? ?\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d\d?\]\])", "[[$1]]$2");
// ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[.{1,30}\|(\d{1,4})\]\](,? ?\-? ?\[\[\d\d? (?:January|February|March|April|May|June|July|August|September|October|November|December)\]\])", "[[$1]]$2");
// ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[.{1,30}\|(\d{1,4})\]\](,? ?\-? ?\[\[\d\d\-\d\d\]\])", "[[$1]]$2");
//'present'
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Present \(time\)\|(Present)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(Present)\]\]", "$1");
//Season
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(spring \(season\)|summer|winter|autumn)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[spring \(season\)\|(spring)\]\]", "$1");
//Identify surprise or 'Easter egg' diversions linking months to year articles.
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4}#[^\|]{1,30}\|(January|February|March|April|May|June|July|August|September|October|November|December)\]\]", "$1");
//'As of year'
ArticleText = Regex.Replace(ArticleText, @"(?i)(As of )\[\[(\d{1,4})\]\]", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(As of \d{1,4})\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(as of \d{1,4})\]\]", "$1");
// months
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(January|February|March|April|May|June|July|August|September|October|November|December)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\|(January|February|March|April|May|June|July|August|September|October|November|December)\]\]", "$1");
//Treat 'Sept' (i.e. month abbreviation) differently from 'sept' (i.e. family)
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(Sept)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[January\|(Jan)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[February\|(Feb)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[March\|(Mar)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[April\|(Apr)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[May\|(May)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[June\|(Jun)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[July\|(Jul)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[August\|(Aug)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[September\|(Sep)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[October\|(Oct)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[November\|(Nov)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[December\|(Dec)\]\]", "$1");
//month piped to number
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\|(\d{1,4})\]\]", "$1");
//month piped to number
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\|(\d{1,4})\]\]", "$1");
//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) \d?\d)\]\]( ?\-? ?)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2})\]\]", "$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) \d?\d)\]\]( ?&[nm]dash; ?)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\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) \d?\d)\]\](\/)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2})\]\]", "$1$2$3$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[((?:January|February|March|April|May|June|July|August|September|October|November|December) \d?\d)\]\]( ?\-? ?)\[\[(\d{1,2})\]\]", "$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) \d?\d)\]\]( ?&[nm]dash; ?)\[\[(\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) \d?\d)\]\](\/)\[\[(\d{1,2})\]\]", "$1$2$3$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d) (?:January|February|March|April|May|June|July|August|September|October|November|December)\]\]( ?\-? ?)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2})\]\]", "$1$2$3$4");
//same again but with ndash instead of hyphen
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d) (?:January|February|March|April|May|June|July|August|September|October|November|December)\]\]( ?&[nm]dash; ?)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2})\]\]", "$1$2$3$4");
//same again but with slash instead of hyphen
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\[]{4})\[\[(\d?\d) (?:January|February|March|April|May|June|July|August|September|October|November|December)\]\](\/)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2})\]\]", "$1$2$3$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2})\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2} (?:January|February|March|April|May|June|July|August|September|October|November|December)\|(\d{1,2})\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|((?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2})\]\]", "$1");
//month+day piped into month+day or vice versa
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,2} (?:January|February|March|April|May|June|July|August|September|October|November|December)\|((?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2})\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2} (?:January|February|March|April|May|June|July|August|September|October|November|December))\]\]", "$1");
// days of the week in full. Optional plurals
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(Mondays?|Tuesdays?|Wednesdays?|Thursdays?|Fridays?|Saturdays?|Sundays?)\]\]", "$1");
// days of the week abbreviated. Leave out 'Sun' as potentially valid link to the Sun. Leave out 'SAT' in upper case as potential link to 'Scholastic achievement/aptitude test'.
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(Mon|Tue|Tues|Wed|Thu|Thur|Thurs|Fri)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"\[\[(Sat)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Mondays?\|(Mondays?|Mon)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Tuesdays?\|(Tuesdays?|Tues?)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Wednesdays?\|(Wednesdays?|Wed)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Thursdays?\|(Thursdays?|Thur?)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Fridays?\|(Fridays?|Fri)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Saturdays?\|(Saturdays?|Sat)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Sundays?\|(Sundays?|Sun)\]\]", "$1");
//4 digit years piped into 2
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[\d{1,4}\|(\d{1,2})\]\]", "$1");
//year: temporary change to protect accessyear. Undone below at #1
ArticleText = Regex.Replace(ArticleText, @"(?i)(accessyear ?= ?)\[\[(\d{1,4})\]\]", "$1xx$2xx");
//Year: temporary change to protext preference dates - y?y?y?. Needed to handle 'year in' piped links
ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[\d\d? (?:January|February|March|April|May|June|July|August|September|October|November|December)\]\],? ? ?)\[\[(\d{1,4})\]\]y?y?y?", "$1xx$2xx");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[\d\d? (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\]\],? ? ?)\[\[(\d{1,4})\]\]y?y?y?", "$1xx$2xx");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d\d?\]\],? ? ?)\[\[(\d{1,4})\]\]y?y?y?", "$1xx$2xx");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d\d?\]\],? ? ?)\[\[(\d{1,4})\]\]y?y?y?", "$1xx$2xx");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,4})\]\]y?y?y?(,? ?\-? ?\[\[(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d\d?\]\])", "xx$1xx$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,4})\]\]y?y?y?(,? ?\-? ?\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d\d?\]\])", "xx$1xx$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,4})\]\]y?y?y?(,? ?\-? ?\[\[\d\d? (?:January|February|March|April|May|June|July|August|September|October|November|December)\]\])", "xx$1xx$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,4})\]\]y?y?y?(,? ?\-? ?\[\[\d\d\-\d\d\]\]y?y?y?)", "xx$1xx$2");
//year: now remove unprotected linked years
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,4})\]\]", "$1");
//year: #1. Undo temporary change to protect accessyear and date preference dates
ArticleText = Regex.Replace(ArticleText, @"(?i)xx(\d{1,4})xx", "[[$1]]");
//remove flagicons from birth and death
ArticleText = Regex.Replace(ArticleText, @"(?i)(birth ?= ?)\{\{flagicon\|[^\}]{1,30}\}\}", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)(death ?= ?)\{\{flagicon\|[^\}]{1,30}\}\}", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)(birth_?place ?= ?)\{\{flagicon\|[^\}]{1,30}\}\}", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)(death_?place ?= ?)\{\{flagicon\|[^\}]{1,30}\}\}", "$1");
//symbol for superscript 2 and 3
//ArticleText = Regex.Replace(ArticleText, @"(?i)<sup>2<\/sup>", "²");
//ArticleText = Regex.Replace(ArticleText, @"(?i)<sup>3<\/sup>", "³");
// Convert degree symbols into ° symbol, ensure preceding space
ArticleText = Regex.Replace(ArticleText, @"(?i)°", "°");
ArticleText = Regex.Replace(ArticleText, @"(?i)º", "°");
//aviation specifications: protect "main=" and "alt=" - undone below
ArticleText = Regex.Replace(ArticleText, @"(?i)((?:main|alt) ?= ?)(\d)", "$1xx$2");
// Celsius spelling errors
ArticleText = Regex.Replace(ArticleText, @"(?i)celsius", "Celsius");
ArticleText = Regex.Replace(ArticleText, @"(?i)celcius", "Celsius");
//Fix common naming error (be careful with this one)
ArticleText = Regex.Replace(ArticleText, @"(?i)centigrade", "Celsius");
//Celsius or Fahrenheit
ArticleText = Regex.Replace(ArticleText, @"(?i)(?:°|deg\.?|degrees)(?: | |)(C|F)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "°$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(?:°|deg\.?)(?: | |)Celsius([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "°C$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)°\[\[", "$1 °[[");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)(\[\[Celsius|°C\]\])", "$1 $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)(\[\[Fahrenheit|°F\]\])", "$1 $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(-?\d[\d,\.]{0,16})(?: |-| |)°F([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|°F|°C|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(-?\d[\d,\.]{0,16})(?: |-| |)(?:deg|degree|degrees)(?: |-| |)Fahrenheit([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|°F|°C}}$3");
// Convert &sup to superscript
ArticleText = Regex.Replace(ArticleText, @"(?i)²", "²");
ArticleText = Regex.Replace(ArticleText, @"(?i)³", "³");
//metre
//delink this common unit
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(metres|meters|metre|meter)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:metres|meters|metre|meter)\|(m)\]\]", "$1");
//space before "m" only when lower case. Check for dollars and pounds to avoid "m" used for millions in money.
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)m([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 m$3");
//convert "metres" to "m" when in parentheses
ArticleText = Regex.Replace(ArticleText, @"(?i)(\(\d[\d,\.]{0,16})(?: |-|)(?:metres|meters|metre|meter)(\))", "$1 m$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\(\d[\d,\.]{0,16}) (?:metres|meters|metre|meter)(\))", "$1 m$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}\|(?:m|ft)\|[^\}]{0,16})\|lk=(?:on|in|out)", "$1");
//metre per second
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)(?:m\/second|m\/sec)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 m/s$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16}) (?:m\/second|m\/sec)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 m/s$3");
//square metre
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)(?: |-| |)sq(?: |\. |-| )m([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 m²$2");
//remove period when followed by close parenthesis character
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}\|(?:sqm|sqft)[^\}]{0,16})\|lk=(?:on|in|out)", "$1");
// millimetre
//delink this common unit
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(milli(?:metres|meters|metre|meter))\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[milli(?:metres|meters|metre|meter)\|(mm)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)mm([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 mm$3");
// centimetre, cubic centimetre
//delink this common unit
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(centi(?:metres|meters|metre|meter))\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[centi(?:metres|meters|metre|meter)\|(cm)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)(cm|cc)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 $3$4");
// kilometre
//delink this common unit
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(kilo(?:metres|meters|metre|meter))\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[kilo(?:metres|meters|metre|meter)\|(km)\]\]", "$1");
//delink this common unit
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}\|(?:mi|km)[^\}]{0,16})\|lk=(?:on|in|out)", "$1");
//square kilometre
//delink this common unit
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(km²)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[square kilomet..\|(km²)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\|])sq\.?(?: |-| |)kms?", "$1km²");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16})00\|ha", "$1|km2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16})(\d)0\|ha", "$1.$2|km2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16})(\d\d)\|ha", "$1.$2|km2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}\|sqmi\|)ha", "$1km2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}\|mi2\|)ha", "$1km2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}\|(?:sqkm|sqmi|km2|mi2)[^\}]{0,16})\|lk=(?:on|in|out)", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{3,16}\|acre\|)ha", "$1km2");
//kilometre per second
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)(?:km\/second|km\/sec)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 km/s$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16}) (?:km\/second|km\/sec)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 km/s$3");
// kilometre per hour
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)(?:km\/hr|km\/ph|kph|kmph|kmh)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 km/h$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16}) (?:km\/hr|km\/ph|kph|kmph|kmh)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 km/h$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)\[\[(?:km\/hr|km\/ph|kph|kmph|kmh)\]\]([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 km/h$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16}) \[\[(?:km\/hr|km\/ph|kph|kmph|kmh)\]\]([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 km/h$3");
//millilitre
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)(ml)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 $3$4");
// ensure spaces and correct case in kilowatt
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)kW([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 kW$3");
// ensure spaces and correct case in hertz
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)Hz([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 Hz$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)kHz([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 kHz$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)GHz([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 GHz$3");
// ensure spaces in megahertz. Must be upper case to avoid clashing with millihertz
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)MHz([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 MHz$3");
// frames per second
ArticleText = Regex.Replace(ArticleText, @"(?i)frames\/s(\W)", "frame/s$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)frames\/sec(\W)", "frame/s$1");
// kilogram
ArticleText = Regex.Replace(ArticleText, @"(?i)kilogrammes", "kilograms");
ArticleText = Regex.Replace(ArticleText, @"(?i)kilogramme", "kilogram");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(kilograms?)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[kilograms?\|(kg|kilograms?)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)grammes([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 grams$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)gramme([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 gram$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)(?:kgs?|\[\[kg\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 kg$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}\|(?:kg|lb)[^\}]{0,16})\|lk=(?:on|in|out)", "$1");
//foot
//delink this common unit
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(foot|feet|ft)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:foot|feet|ft|foot)\|(foot|feet|ft)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[foot \((?:unit|length|unit of length)\)\|(foot|feet|ft)\]\]", "$1");
//convert "foot" to "ft" when in parentheses
ArticleText = Regex.Replace(ArticleText, @"(?i)(\(\d[\d,\.]{0,16})(?: |-|)(?:feet|foot)(\))", "$1 ft$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\(\d[\d,\.]{0,16}) (?:feet|foot)(\))", "$1 ft$2");
//remove trailing period when in parentheses
ArticleText = Regex.Replace(ArticleText, @"(?i)(\(\d[\d,\.]{0,16})(?: |-|)ft\.(\))", "$1 ft$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\(\d[\d,\.]{0,16}) ft\.(\))", "$1 ft$2");
// square foot
//convert "sq foot" to "sq ft"
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)( |-)sq\.?( |-|)(feet|foot|ft)", "$1 sq ft");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d) sq\.? (feet|foot|ft)", "$1 sq ft");
//convert "square ft" to "sq ft"
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)( |-)square( |-)ft", "$1 sq ft");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d) square ft", "$1 sq ft");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)sq(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|sqft|sqm|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)square(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|sqft|sqm}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)square(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|sqft|sqm|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)thousand(?: |-| |)(?:sq|square)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000|sqft|sqm|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)thousand(?: |-| |)(?:sq|square)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000|sqft|sqm}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)thousand(?: |-| |)(?:sq|square)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000|sqft|sqm|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000|sqft|sqm|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d)(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,00000|sqft|sqm|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d\d)(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,0000|sqft|sqm|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000|sqft|sqm}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d)(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,00000|sqft|sqm}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d\d)(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,0000|sqft|sqm}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000|sqft|sqm|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d)(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,00000|sqft|sqm|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d\d)(?: |-| |)million(?: |-| |)(?:sq|square)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,0000|sqft|sqm|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)ft²([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|sqft|sqm|abbr=on}}$3");
//cubic foot
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Tcuft|km3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Tcuft|km3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Tcuft|km3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Gcuft|m3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Gcuft|m3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Gcuft|m3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)(?:cu|cubic)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Mcuft|m3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)(?:cu|cubic)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Mcuft|m3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)(?:cu|cubic)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Mcuft|m3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)(?:cu|cubic)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|cuft|m3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)(?:cu|cubic)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|cuft|m3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)(?:cu|cubic)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|cuft|m3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)(?:cu|cubic)\.?(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|cuft|m3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)(?:cu|cubic)\.?(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|cuft|m3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)(?:cu|cubic)\.?(?: |-| |)ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|cuft|m3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)(?:cu|cubic)\.?(?: |-| |)ft³([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|cuft|m3|abbr=on}}$3");
//cubic foot as bcf, tcf etc
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)bcf([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|Gcuft|m3|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)bcf/d([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|Gcuft/d|m3/d|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)tcf([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|Tcuft|km3|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)tcf/d([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|Tcuft/d|km3/d|abbr=on}}$3");
//convert excessive zeros for cubic foot
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000000000\|cuft\|", "$1|Tcuft|");
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000000\|cuft\|", "$1|Gcuft|");
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000\|cuft\|", "$1|Mcuft|");
//convert excessive zeros for cubic feet
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000000000\|cuft\|", "$1|Tcuft|");
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000000\|cuft\|", "$1|Gcuft|");
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000\|cuft\|", "$1|Mcuft|");
//yard
//ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(?:yards?)\|(yards?|yds?)\]\]", "$1");
//ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(yards?|yds?)\]\]", "$1");
//ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)yards([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|yd}}$3");
//ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)yard([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|yd|sing=on}}$3");
//ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)yds?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|yd|abbr=on}}$3");
//cubic yard
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)trillion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yards([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000000000|cuyd|m3}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)trillion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yard([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000000000|cuyd|m3|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)trillion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yds?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000000000|cuyd|m3|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)billion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yards([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000000|cuyd|m3}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)billion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yard([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000000|cuyd|m3|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)billion(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yds?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000000|cuyd|m3|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)million(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yards([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000|cuyd|m3}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)million(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yard([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000|cuyd|m3|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)million(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yds?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000|cuyd|m3|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)thousand(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yards([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000|cuyd|m3}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)thousand(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yard([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000|cuyd|m3|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)thousand(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yds?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000|cuyd|m3|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yards([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|cuyd|m3}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yard([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|cuyd|m3|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yds?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|cuyd|m3|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)(?:cu|cubic)\.?(?: |-| |)yd³([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|cuyd|m3|abbr=on}}$3");
//oil barrels per day
//change 'bpd' and 'b/d' into bbl/d
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)(?:bpd|b\/d)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2bbl/d$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)barrels per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Toilbbl/d|km3/d}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)barrel per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Toilbbl/d|km3/d|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)bbl/d([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Toilbbl/d|km3/d|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)barrels per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Goilbbl/d|m3/d}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)barrel per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Goilbbl/d|m3/d|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)bbl/d([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Goilbbl/d|m3/d|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)barrels per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Moilbbl/d|m3/d}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)barrel per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Moilbbl/d|m3/d|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)bbl/d([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Moilbbl/d|m3/d|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)barrels per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|oilbbl/d|m3/d}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)barrel per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|oilbbl/d|m3/d|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)bbl/d([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|oilbbl/d|m3/d|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)barrels per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|oilbbl/d|m3/d}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)barrel per day([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|oilbbl/d|m3/d|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)bbl/d([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|oilbbl/d|m3/d|abbr=on}}$3");
//oil barrels
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)barrels([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Toilbbl|km3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)barrel([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Toilbbl|km3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)trillion(?: |-| |)bbl([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Toilbbl|km3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)barrels([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Goilbbl|m3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)barrel([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Goilbbl|m3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)billion(?: |-| |)bbl([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Goilbbl|m3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)barrels([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Moilbbl|m3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)barrel([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Moilbbl|m3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)million(?: |-| |)bbl([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3|Moilbbl|m3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)barrels([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|oilbbl|m3}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)barrel([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|oilbbl|m3|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(\.[\d,]{1,3})?(?: |-| |)thousand(?: |-| |)bbl([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,000|oilbbl|m3|abbr=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)barrels([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|oilbbl|m3}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)barrel([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|oilbbl|m3|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)bbl([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|oilbbl|m3|abbr=on}}$3");
//convert excessive zeros for oil
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000000000\|oilbbl\|", "$1|Toilbbl|");
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000000\|oilbbl\|", "$1|Goilbbl|");
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|\d{1,16})000000\|oilbbl\|", "$1|Moilbbl|");
//oil: cubic km to cubic m
ArticleText = Regex.Replace(ArticleText, @"(?i)(Moilbbl\|)km3", "$1m3");
ArticleText = Regex.Replace(ArticleText, @"(?i)(koilbbl\|)km3", "$1m3");
//oil: convert litres into cubic metres
ArticleText = Regex.Replace(ArticleText, @"(?i)(oilbbl\|)TL", "$1km3");
ArticleText = Regex.Replace(ArticleText, @"(?i)(oilbbl\|)[kMG]L", "$1m3");
//embed 'per day' into pre-existing conversions
ArticleText = Regex.Replace(ArticleText, @"(?i)(oilbbl)\|(k?m3)(}})(?: |-| |)(?:per|a)(?: |-| |)day", "$1/d|$2/d$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)(oilbbl)\|(k?m3)(\|abbr=on}})(?: |-| |)(?:per|a)(?: |-| |)day", "$1/d|$2/d$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)(oilbbl)\|(k?m3)(\|sing=on}})(?: |-| |)(?:per|a)(?: |-| |)day", "$1/d|$2/d$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)(oilbbl)\|(k?m3)(}})/d", "$1/d|$2/d");
//feet per second
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)(?:ft\/second|ft\/sec)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 ft/s$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16}) (?:ft\/second|ft\/sec)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 ft/s$3");
//feet per second:plural
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)feet per second([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft/s|m/s}}$3");
//feet per second:singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)foot per second([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft/s|m/s|sing=on}}$3");
//feet per second:abbreviated
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)ft\/s([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft/s|m/s|abbr=on}}$3");
//ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)f\/s([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft/s|m/s|abbr=on}}$3");
//ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)fps([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft/s|m/s|abbr=on}}$3");
//foot - remove period when followed by parentheses
ArticleText = Regex.Replace(ArticleText, @"(\d ft)\.( \(\d)", "$1$2");
// foot and inch
ArticleText = Regex.Replace(ArticleText, @"(?i)(ength[.]{1,3})(\d{1,4}) ?[""’] ?(\d{1,3}) ?[""”]", "$1$2 ft $3 in");
ArticleText = Regex.Replace(ArticleText, @"(?i)(idth[.]{1,3})(\d{1,4}) ?[""’] ?(\d{1,3}) ?[""”]", "$1$2 ft $3 in");
ArticleText = Regex.Replace(ArticleText, @"(?i)([\(\|:] ?\d{1,4}) ?[""’] ?(\d{1,3}) ?[""”]([^NESW])", "$1 ft $2 in$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d) ?ft ?(\d{1,3}) ?in", "$1 ft $2 in");
// knot
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)( |-| )(?:kts|kt|knt)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2knots$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[knot \(unit\)\|", "[knot (speed)|");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[kts\]\]", "[[knot (speed)|knots]]");
ArticleText = Regex.Replace(ArticleText, @"(?i)\|kts\]\]", "|knots]]");
//convert knot template to kn to match km
ArticleText = Regex.Replace(ArticleText, @"(?i)({{convert\|[\d\.]{1,16})\|knot\|", "$1|kn|");
//nautical mile - rename "miles" as "nautical miles" when followed by knots or conversion code
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)(?: |-| |)miles (?:at|@) ([\d\.]{1,9}(?: |-| |)knots|{{convert)", "$1 nautical miles at $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)( |-| )(?:mi|nm|nmi) (?:at|@) ([\d\.]{1,9}(?: |-| |)knots|{{convert)", "$1$2nmi at $3");
//nautical mile: plural unlinked
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)nautical(?: |-| |)miles([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|nmi|km}}$3");
//nautical mile: plural linked with "s" inside link
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)\[\[nautical(?: |-| |)miles\]\]([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|nmi|km}}$3");
//nautical mile: plural linked with "s" outside link
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)\[\[nautical(?: |-| |)mile\]\]s([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|nmi|km}}$3");
//nautical mile: singular unlinked
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)nautical(?: |-| |)mile([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|nmi|km|sing=on}}$3");
//nautical mile: singular linked
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)\[\[nautical(?: |-| |)mile\]\]([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|nmi|km|sing=on}}$3");
//nautical mile: abbreviated
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:\[\[nautical mile\|nmi?\]\]|nmi)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|nmi|km|abbr=on}}$3");
//nautical mile: in full
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] one(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (1.9 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] two(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (4 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] three(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (6 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] four(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (7 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] five(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (9 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] six(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (11 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] seven(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (13 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] eight(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (15 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] nine(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (17 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] ten(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (19 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] eleven(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (20 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] twelve(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (22 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] thirteen(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (24 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] fourteen(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (26 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] fifteen(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (28 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] sixteen(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (30 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] seventeen(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (31 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] eighteen(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (33 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] nineteen(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (35 km)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] twenty(?: |-| |)nautical(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (37 km)$2");
//knot - plural
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:knots|\[\[knot \(speed\)\|(?:knots\]\]|knot\]\]s))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|knot|km/h}}$3");
//knot - singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:knot|\[\[knot \(speed\)\|knot\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|knot|km/h|sing=on}}$3");
//knot - abbreviation
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:kts?|\[\[knot \(speed\)\|kts?\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|knot|km/h|abbr=on}}$3");
//mile - lower case to avoid proper names like "Five Mile Road"
//delink this common unit
ArticleText = Regex.Replace(ArticleText, @"\[\[(mi|mile|miles)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"\[\[(?:mile|miles)\|(mi|mile|miles)\]\]", "$1");
//mile - protect "miles per hour" - undone below
ArticleText = Regex.Replace(ArticleText, @"(?i)(miles?) (per)", "$1xx$2");
//miles: plural
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:miles|\[\[miles\]\]|\[\[mile\]\]s)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|mi|km}}$3");
//miles: singular
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:mile|\[\[mile\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|mi|km|sing=on}}$3");
//miles: abbreviated
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)mi([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|mi|km|abbr=on}}$3");
//miles: in full
ArticleText = Regex.Replace(ArticleText, @"([^y] one(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (1.6 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] two(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (3 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] three(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (5 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] four(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (6 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] five(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (8 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] six(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (10 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] seven(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (11 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] eight(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (13 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] nine(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (14 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] ten(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (16 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] eleven(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (18 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] twelve(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (19 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] thirteen(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (19 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] fourteen(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (21 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] fifteen(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (24 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] ixteen(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (26 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] seventeen(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (27 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] eighteen(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (29 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] nineteen(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (30 km)$2");
ArticleText = Regex.Replace(ArticleText, @"([^y] twenty(?: |-| |)miles?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (32 km)$2");
//mile - unprotect "miles per hour"
ArticleText = Regex.Replace(ArticleText, @"(?i)(miles?)xx(per)", "$1 $2");
//mile per hour
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)m\.?p\.?h([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|mi/h|km/h|abbr=on}}$3");
// square mile
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)(?: |-)sq(?: |\. |-)mi([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 sq mi$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(square mile)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[square mile\|(sq mi)\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)(sq)(?: |-| |)(mile)", "$1uare $2");
// square mile:plural
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)square(?: |-| |)miles([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|mi2|km2}}$3");
// square mile:singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)square(?: |-| |)mile([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|mi2|km2|sing=on}}$3");
// square mile:abbreviated
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)sq(?: |-| |)mi([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|mi2|km2|abbr=on}}$3");
//acre foot:plural
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{3,16}[\d,\.]{0,16})(?: |-| |)acre(?: |-| |)feet([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|acre feet}}$3");
//acre foot:singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{3,16}[\d,\.]{0,16})(?: |-| |)acre(?: |-| |)foot([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|acre feet|sing=on}}$3");
//acre foot:abbreviation
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{3,16}[\d,\.]{0,16})(?: |-| |)(?:acre|ac\.?)(?: |-| |)(?:foot|feet|ft)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|acre ft|abbr=on}}$3");
//acre
//acres - temporary change to protect acre feet. changed below
ArticleText = Regex.Replace(ArticleText, @"(?i)(acre)(.(?:feet|foot|ft))", "xx$1yy$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)-(acre)", "$1 $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)(?: |-| |)surface(?: |-| |)acre", "$1 acre");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)thousand(?: |-| |)(?:acres|\[\[acres\]\]|\[\[acre\]\]s)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000|acre|km2}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)thousand(?: |-| |)(?:acre|\[\[acre\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000|acre|km2|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})(?: |-| |)million(?: |-| |)(?:acres|\[\[acres\]\]|\[\[acre\]\]s)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2,000000|acre|km2}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d)(?: |-| |)million(?: |-| |)(?:acres|\[\[acres\]\]|\[\[acre\]\]s)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,00000|acre|km2}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d)(?: |-| |)million(?: |-| |)(?:acre|\[\[acre\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,00000|acre|km2|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d\d)(?: |-| |)million(?: |-| |)(?:acres|\[\[acres\]\]|\[\[acre\]\]s)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,0000|acre|km2}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{1,16})\.(\d\d)(?: |-| |)million(?: |-| |)(?:acre|\[\[acre\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2$3,0000|acre|km2|sing=on}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] one(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (4,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)( a(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (4,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] two(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (8,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] three(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (12,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] four(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (16,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] five(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (20,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] six(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (24,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] seven(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (28,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] eight(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (32,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] nine(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (36,000 km²)$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^y] ten(?: |-| |)million(?: |-| |)acres?)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (40,000 km²)$2");
//acre:plural
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{3,16}[\d,\.]{0,16})(?: |-| |)(?:acres|\[\[acres\]\]|\[\[acre\]\]s)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|acre|km2}}$3");
//acre:singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )([\d,]{3,16}[\d,\.]{0,16})(?: |-| |)(?:acre|\[\[acre\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|acre|km2|sing=on}}$3");
//acres - undo temporary change to protect acre feet
ArticleText = Regex.Replace(ArticleText, @"(?i)xx(acre)yy", "$1");
//remove commas from numerical values in convert template
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}),(\d)", "$1$2");
// foot pound
ArticleText = Regex.Replace(ArticleText, @"(?i)(\W)lbs?[ -.·•\/]{1,2}ft([^²\w])", "$1ft·lbf$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\W)lbs?ft([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1ft·lbf$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)ftlbs?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "ft·lbf$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)ft\W{1,2}lbs?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "ft·lbf$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)ftlbs?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "ft·lbf$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)ft\W{1,2}lbf([^\|])", "ft·lbf$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)ft\W{1,2}lbff", "ft·lbf");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)ft.lbf([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft.lbf|N.m|abbr=on}}$3");
//pound force
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})( |-| |)lbs?.? (thrust|of thrust|force|of force)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2$3lbf $4$5");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16}000)(?: |-| |)pounds force([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lbf|kN}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)pounds force([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lbf|N}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16}000)(?: |-| |)pound force([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lbf|kN|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)pound force([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lbf|N|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16}000)(?: |-| |)lbf([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lbf|kN|abbr=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)lbf([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lbf|abbr=on}}$3");
//pound weight
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[pound \(weight\)\|([^\]]{1,30})\]\]", "[[pound (mass)|$1]]");
ArticleText = Regex.Replace(ArticleText, @"(?i)\|lbs?\.\]\]", "|lb]]");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d) ?lbs?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 lb$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d\+?) ?lbs?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 lb$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d) lbs?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 lb$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)lb([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lb|abbr=on}}$3");
//pounds and ounces - plural
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)pounds(?: |-| |)(\d[\d,\.]{0,16})(?: |-| |)ounces?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lb|$3|oz|kg}}$4");
//pounds and ounces - singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)pound(?: |-| |)(\d[\d,\.]{0,16})(?: |-| |)ounces?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lb|$3|oz|kg|sing=on}}$4");
//pounds and ounces - abbreviated
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)lbs?\.?,?(?: |-| |)(\d[\d,\.]{0,16})(?: |-| |)oz\.?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|lb|$3|oz|kg|abbr=on}}$4");
//grain
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)grains([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|gr}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)grain([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|gr|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)gr([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|gr|abbr=on}}$3");
//foot and inch: plural
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)feet\.?(?: |-| |)(\d[\d,\.]{0,16})(?: |-| |)(?:in|ins|inch|inches)\.?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft|$3|in|m}}$4");
//foot and inch: singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)foot\.?(?: |-| |)(\d[\d,\.]{0,16})(?: |-| |)(?:in|ins|inch|inches)\.?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft|$3|in|m|sing=on}}$4");
//foot and inch: abbreviated
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)ft\.?(?: |-| |)(\d[\d,\.]{0,16})(?: |-| |)(?:in|ins|inch|inches)\.?([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft|$3|in|m|abbr=on}}$4");
//foot (again). Parsed after "foot per second" and "foot pound"
//foot: plural
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:feet|\[\[Foot \(unit of length\)\|feet\]\])([^²³·\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ft|m}}$3");
//foot: singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:foot|\[\[Foot \(unit of length\)\|foot\]\])([^²³·\w\d\(\)\/\\][^\d\(\)\/\\p])", "$1{{convert|$2|ft|m|sing=on}}$3");
//foot: abbreviated
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:ft|\[\[Foot \(unit of length\)\|ft\]\])([^²³·\w\d\(\)\/\\][^\d\(\)\/\\lm])", "$1{{convert|$2|ft|m|abbr=on}}$3");
//inch: plural
//'inches of snow' converts to cm
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\Wt""’] )(\d[\d,\.]{0,16})(?: |-| |)inches(?: |-| |)of(?: |-| |)snow([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|in|cm}}$3");
//other inches convert to mm
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\Wt""’] )(\d[\d,\.]{0,16})(?: |-| |)inches([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|in|mm}}$3");
// inch: plural with number in words
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] three(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (76 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] four(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (102 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] five(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (127 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] six(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (152 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] seven(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (178 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] eight(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (203 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] nine(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (229 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] ten(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (254 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] eleven(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (279 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] twelve(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (305 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] thirteen(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (330 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] fourteen(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (356 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] fifteen(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (381 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] sixteen(?: |-| |)(?:inches|\[\[inches\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (406 mm) $2");
//inch: singular
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\Wt""’] )(\d[\d,\.]{0,16})(?: |-| |)(?:inch|\[\[inch\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|in|mm|sing=on}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}\|(?:in|mm|cm)[^\}]{0,16})\|lk=(?:on|in|out)", "$1");
// inch: singular with number in words
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] three(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (76 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] four(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (102 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] five(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (127 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] six(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (152 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] seven(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (178 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] eight(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (203 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] nine(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (229 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] ten(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (254 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] eleven(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (279 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] twelve(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (305 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] thirteen(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (330 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] fourteen(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (356 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] fifteen(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (381 mm) $2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^ty] sixteen(?: |-| |)(?:inch|\[\[inch\]\]))([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 (406 mm) $2");
// horsepower
ArticleText = Regex.Replace(ArticleText, @"(?i)\.28 ?(bhp|ihp|shp)\.29\|", "($1)|");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)(?: |-|)(horsepower|hp|bhp|ihp|shp)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 $2$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d) (horsepower|hp|bhp|ihp|shp)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 $2$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)(?: |-|)horse(?: |-|)power([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 horsepower$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(?:horsepower|\[\[horsepower\]\])([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|hp}}$3");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(indicated(?: |-| |)horsepower)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|ihp}}$4");
ArticleText = Regex.Replace(ArticleText, @"(?i)([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-| |)(hp|bhp|ihp|shp)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1{{convert|$2|$3|abbr=on}}$4");
// rpm
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d) ?rpm([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 rpm$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d) rpm([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 rpm$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)(\d)\-rpm([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1 rpm$2");
// bits per second
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)([KkMmGgTt]|)(?:bps|bits\/s|b\/s|bits?\/sec)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 $3bit/s$4");
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: )([KkMmGgTt]|)(?:bps|bits\/s|b\/s|bits?\/sec)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 $3bit/s$4");
// bytes per second
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: |-|)([KkMmGgTt]|)(?:Bps|bytes?\/s)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 $3byte/s$4");
ArticleText = Regex.Replace(ArticleText, @"([^\d\(\)\/\\] )(\d[\d,\.]{0,16})(?: )([KkMmGgTt]|)(?:Bps|bytes?\/s)([^²³\w\d\(\)\/\\][^\d\(\)\/\\])", "$1$2 $3byte/s$4");
// capitalization of prefix with bits and bytes
ArticleText = Regex.Replace(ArticleText, @"K(bit|B|byte)\/s", "k$1/s");
ArticleText = Regex.Replace(ArticleText, @"m(bit|B|byte)\/s", "M$1/s");
ArticleText = Regex.Replace(ArticleText, @"g(bit|B|byte)\/s", "G$1/s");
ArticleText = Regex.Replace(ArticleText, @"t(bit|B|byte)\/s", "T$1/s");
//aviation specifications: unprotect "main=" and "alt="
ArticleText = Regex.Replace(ArticleText, @"(?i)((?:main|alt) ?= ?)xx(\d)", "$1$2");
//replace other templates with convert template
ArticleText = Regex.Replace(ArticleText, @"(?i){{mi to km\|(\d{1,9})}}", "{{convert|$1|mi|km}}");
ArticleText = Regex.Replace(ArticleText, @"(?i){{mi to km\|(\d{1,9})\|round[^\}]{1,5}}}", "{{convert|$1|mi|km}}");
ArticleText = Regex.Replace(ArticleText, @"(?i){{mi2 to km2\|(\d{1,9})}}", "{{convert|$1|mi|km}}");
ArticleText = Regex.Replace(ArticleText, @"(?i){{mi2 to km2\|(\d{1,9})\|round[^\}]{1,5}}}", "{{convert|$1|mi|km}}");
//remove commas from numerical values in convert template
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}),(\d)", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}),(\d)", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}),(\d)", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}),(\d)", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|\d{1,16}),(\d)", "$1$2");
//remove leading zeros from convert template
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|)0(\d)", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|)0(\d)", "$1$2");
ArticleText = Regex.Replace(ArticleText, @"(?i)({convert\|)0(\d)", "$1$2");
//Remove surprise or "Easter egg" diversions linking unit name to orders of magnitude articles
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[1 ?_?E ?[\-\+]?\d{1,2} ?..?\|([^\]]{1,50})\]\]", "$1");
ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[Orders of magnitude \([^\)]{1,30}\)\|([^\]]{1,50})\]\]", "$1");
return ArticleText;
}