我有一个这样的字符串
字符串文本 =
<p><span><span id="test">Meanwhile, the Cougars are coming off of a win against Eastern
Washington University in which they scored 88 points and had three players score at least
15 points. <span>Motum</span> recorded his fourth career double-double in the game as well.
</span></span></p>
<p><span>After Dexter Kernich-Drew, Royce Woolridge, and Will DiIorio were unable to
practice last Wednesday before the game against EWU, the team is healthy and ready to play
against Utah Valley. </span></p>
<p><span><span><span>Woolridge</span>, a <span>redshirt</span> sophomore transfer who has
started at guard in the first two games this season, scored seven points and had two assists
against EWU. He also had 10 points and three assists against Saint Martin’s. </span>
</span></p>
而且我需要摆脱所有没有属性而只是包装内容的 's。我到目前为止的模式是
text = Regex.Replace(text, @"</?span([^>]*|/)?>", "", RegexOptions.Compiled);
这只是拉出所有跨度离开
<p>Meanwhile, the Cougars are coming off of a win against Eastern Washington University
in which they scored 88 points and had three players score at least 15 points. Motum
recorded his fourth career double-double in the game as well. </p>
<p>After Dexter Kernich-Drew, Royce Woolridge, and Will DiIorio were unable to practice
last Wednesday before the game against EWU, the team is healthy and ready to play
against Utah Valley. </p>
<p>Woolridge, a redshirt sophomore transfer who has started at guard in the first
two games this season, scored seven points and had two assists against EWU. He also had
10 points and three assists against Saint Martin’s. </p>
那很接近,但我需要第一个
它看起来像
<p><span id="test">Meanwhile, the Cougars are coming off of a win against Eastern
Washington University in which they scored 88 points and had three players score at
least 15 points. Motum recorded his fourth career double-double in the game as well.
</span></p>
这里的问题是如何找到没有属性的嵌套跨度并删除它们。我确实有一些其他尝试使用回溯作为结束标记,但这是唯一一个最接近的。