Jump to content

User:BattyBot/CS1 maint: Extra text

From Wikipedia, the free encyclopedia
public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
 {
  Skip = false;
  Summary = "";
//-----
//Format:
//ArticleText = Regex.Replace(ArticleText, @"(?i){{(\s*[Cc]it(?:e|ation))([^}]+)(\s*\|\s*parameter\s*=\s*) find (\s*[\|}<])", "{{$1$2$3 replace $4");
//This is designed to only fix {{cite foo}} or {{citation}} templates (or associated wrapper templates)
//Most rules will check for the field value followed by ending pipe or right curly brace
//Note that this module will not fix every error - the goal is to fix some properly and not break anything
//-----
//remove "edition" from edition field
  ArticleText = Regex.Replace(ArticleText, @"(?i){{(\s*[Cc]it(?:e|ation))([^}]+)(\s*\|\s*edition\s*=[\s\w\.\/]+)\s+(?:ed\.?|edition)\.?(\s*[\|}<])", "{{$1$2$3$4");
//remove "page" from page field
  ArticleText = Regex.Replace(ArticleText, @"(?i){{(\s*[Cc]it(?:e|ation))([^}]+)(\s*\|\s*pages?\s*=\s*)pages?\s+([\d|xvi|–]+)(\s*[\|}<])", "{{$1$2$3$4$5");
  ArticleText = Regex.Replace(ArticleText, @"(?i){{(\s*[Cc]it(?:e|ation))([^}]+)(\s*\|\s*pages?\s*=\s*)p\.?\s*(\d+)(\s*[\|}<])", "{{$1$2$3$4$5");
 return ArticleText;
 }