62,254
社区成员
发帖
与我相关
我的任务
分享MatchCollection allMatchResults = null;
try {
Regex regexObj = new Regex(@"(?<=<td>)\d+(?=\s+</td>)");
allMatchResults = regexObj.Matches(@"<td>风阻系数(cd): </td> <td>100 </td> </tr> <tr> <td>整备质量(kg): </td> <td>1890 </td> <td>最大总质量(kg): </td> <td>2490 </td> ");
if (allMatchResults.Count > 0) {
// Access individual matches using allMatchResults.Item[]
} else {
// Match attempt failed
}
} catch (ArgumentException ex) {
// Syntax error in the regular expression
}
(?<=<td>)\d+(?=\s+</td>)