日期:2014-05-17 浏览次数:20458 次
<div>{ id="a" /}</div> <div>{ id="{ id="c" /}" /}</div>
private void getNesting(string src, Regex reg, List<string> list) { MatchCollection mc = reg.Matches(src); foreach (Match m in mc) { list.Add(m.Value); src = m.Value.Remove(m.Value.Length - 1, 1); if (reg.IsMatch(src)) { getNesting(src, reg, list); } } }