例如:
string strContent="1111122{#top#}222222333333333{#bottom#}4444444444";我想通过正则表达式匹配之后取出的结果放入数组,形式如
string Template[]=new {"{top}","{#bottom#}"}这个功能应该如何写啊!谢谢啊!
string strContent="1111122{#top#}222222333333333{#bottom#}4444444444";我想通过正则表达式匹配之后取出的结果放入数组,形式如
string Template[]=new {"{top}","{#bottom#}"}这个功能应该如何写啊!谢谢啊!
string strContent = "1111122{#top#}222222333333333{#bottom#}4444444444";
MatchCollection mc = Regex.Matches(strContent, "{[^}]*}");
string[] result = new string[mc.Count];
for (int i = 0; i < result.Length; i++)
{
result[i] = mc[i].Value;
}