ASP.NET小收集:获取可替换部分标签

发布系统,获取模板上可替换的标签

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());
}
}
}

因为获取的只是标签名称,所以直接使用ArrayList进行保存,本代码中AL就是一个ArrayList

posted @ 2008-09-12 17:57  仲卿  阅读(244)  评论(0编辑  收藏  举报