62,254
社区成员
发帖
与我相关
我的任务
分享(?<=<([^>]+)>)[^<]+(?=</\1>) string test = "<UserID>2566</UserID><Time>5852</Time><Status>1</Status>";
Regex reg = new Regex(@"(?i)<UserID>(\d+)</UserID><Time>(\d+)</Time><Status>(\d+)</Status>");
MatchCollection mc = reg.Matches(test);
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups[1].Value + "\n";
richTextBox2.Text += m.Groups[2].Value + "\n";
richTextBox2.Text += m.Groups[3].Value + "\n";
}