请问,为什么提取到的都是空值呢,正则写错了吗?
string s = ...
<td row="1" width="33.3%" class="" style="cursor:pointer" >5510</td>
<td row="1" width="33.3%" class="" style="cursor:pointer" >1060</td>
...;
var matches = Regex.Matches(s, "(?<=.*pointer.*>).{4,5}(?=.*</td)");
String[] ss = new String[7];
int j = 0;
foreach (Match item in matches)
{
ss[j] = item.ToString().Trim(); j++;
}
提取5510等几个数字,然后打印
for (int i = 0; i < ss.Length; i++) { Trace.WriteLine(ss[i]); }
可是打印出来的全是空值,为什么啊?