110,538
社区成员
发帖
与我相关
我的任务
分享
List<string> list = new List<string>();
string test = "[@aaa]asdfagaeg[@bbb]hrhsrth[@ccc]";
MatchCollection mc = Regex.Matches(test, @"\[@(?<content>[^\]]*)\]");
foreach (Match m in mc)
list.Add(m.Groups["content"].Value);
//验证结果
foreach (string s in list)
MessageBox.Show(s);