User:BattyBot/Blank Persondata
Appearance
public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
Skip = false;
Summary = "";
//-----
//This custom module is designed to remove the deprecated {{Persondata}} template
//when the ONLY value in the {{Persondata}} parameters is the NAME
//-----
//Remove Persondata comment
ArticleText = Regex.Replace(ArticleText, @"(?i) *<!-- Metadata: see \[\[Wikipedia:Persondata\]\]\.? -->", "");
//Remove Persondata with only NAME
ArticleText = Regex.Replace(ArticleText, @"(?i){{Persondata\s*\n\s*\|\s*NAME\s*=[\w\.,\-\s]*\n+(?:\s*\|\s*ALTERNATIVE NAMES\s*=\s*\n+)?\s*\|\s*SHORT DESCRIPTION\s*=\s*\n+\s*\|\s*DATE OF BIRTH\s*=\s*\n+\s*\|\s*PLACE OF BIRTH\s*=\s*\n+\s*\|\s*DATE OF DEATH\s*=\s*\n+\s*\|\s*PLACE OF DEATH\s*=\s*\n?}}", "", RegexOptions.Singleline);
//Remove empty Persondata
ArticleText = Regex.Replace(ArticleText, @"(?i){{Persondata *}}", "");
return ArticleText;
}