发布系统,获取模板上可替换的标签
private void AnalyzeTempSrc()
{
Regex AnReg = new Regex(@">[\s]*(\$.*)[\s]*<\/", RegexOptions.IgnoreCase);
MatchCollection ReplaceCollection = AnReg.Matches(TempSrc);
AL.Clear();
if (ReplaceCollection.Count > 0)
{
for (int i = 0; i < ReplaceCollection.Count; i++)
{
AL.Add(ReplaceCollection[i].Groups[1].Value.Split('<')[0].Trim());
}
}
}
{
Regex AnReg = new Regex(@">[\s]*(\$.*)[\s]*<\/", RegexOptions.IgnoreCase);
MatchCollection ReplaceCollection = AnReg.Matches(TempSrc);
AL.Clear();
if (ReplaceCollection.Count > 0)
{
for (int i = 0; i < ReplaceCollection.Count; i++)
{
AL.Add(ReplaceCollection[i].Groups[1].Value.Split('<')[0].Trim());
}
}
}
因为获取的只是标签名称,所以直接使用ArrayList进行保存,本代码中AL就是一个ArrayList