User:Lightmouse/AWB/scripts/days of the week
Appearance
//days of the week
//
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);
// 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");
return ht.AddBack(ArticleText);
return ArticleText;
}
//