110,534
社区成员
发帖
与我相关
我的任务
分享
string test = "<p> <font size=\"3\" color=\"#008000\">你好</font> </p> ";
MatchCollection mc = Regex.Matches(test, @"<([^\s>]*)[^>]*>([^<>]*)</\1>");
List<string> list = new List<string>();
foreach (Match m in mc)
{
list.Add(m.Groups[2].Value);
}
string test = "<p> <font size=\"3\" color=\"#008000\">你好</font> </p> ";
MatchCollection mc1 = Regex.Matches(test, @"<([^\s>]*)[^>]*>([^<>]*)</\1>");
string[] div1 = new string[mc1.Count];
for (int i = 0; i < mc1.Count; i++)
{
div1[i] = mc1[i].Groups[2].Value;
}
string test = "<p> <font size=\"3\" color=\"#008000\">你好</font> </p> ";
MatchCollection mc = Regex.Matches(test, @"<([^\s>]*)[^>]*>([^<>]*)</\1>");
foreach (Match m in mc)
{
richTextBox1.Text += m.Groups[2].Value + "\n";
}
MatchCollection mc = Regex.Matches(str, @"<([^\s>]*)[^>]*>([^<>]*)</\1>");
foreach (Match m in mc)
{
richTextBox1.Text += m.Groups[2].Value + "\n";
}
string result = Regex.Replace(yourStr, @"<[^>]*>", "");
MessageBox.Show(result);