我想剥离html标签,只返回标签之间的文本.这是我目前正在使用的.
string regularExpressionPattern1 = @"<td(.*?)<\/td>";
Regex regex = new Regex(regularExpressionPattern1, RegexOptions.Singleline);
MatchCollection collection = regex.Matches(value.ToString());
Run Code Online (Sandbox Code Playgroud)
我现在得到了<td>13</td>,我只想要13.
谢谢,
小智 6
您需要获得组的价值而不是比赛的价值。尝试这个
Match m = collection[0];
var stripped = m.Groups[1].Value;
Run Code Online (Sandbox Code Playgroud)