User:Yobot/Replacing

From Wikipedia, the free encyclopedia
private static readonly Regex InfoboxName = Tools.NestedTemplateRegex(new List<string>("Infobox power station".Split(',')));
public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
	Skip = false;
	Summary = "";

	foreach(Match m in InfoboxName.Matches(ArticleText))
	{
		string newValue = m.Value;
		newValue = Tools.RenameTemplateParameter(newValue, "technology", "th_technology");
		ArticleText = ArticleText.Replace(m.Value, newValue);
	}
	return ArticleText;
}