我正在尝试解码此HTML输入字符串:
<tbody>
<tr class="row0 first" >
<td class="col0 first" data-colid="0" >
<span>Previous close</span>
</td>
<td class="col1 last" data-colid="1" >
<span>39.64</span>
</td>
</tr>
<tr class="row1" >
<td class="col0 first" data-colid="0" >
<span>Open</span>
</td>
<td class="col1 last" data-colid="1" >
<span>39.50</span>
</td>
</tr>
<tr class="row2" >
<td class="col0 first" data-colid="0" >
我试过这个正则表达式:
\<span\>Previous\sclose\<\/span\>[\w\n\r\<\/\s\>\=\"\-]+\<span\>[0-9\.]+\<\/span\>
我得到的输出是:
<span>Previous close</span>
</td>
<td class="col1 last" data-colid="1" >
<span>39.64</span>
我只对39.64的价值感兴趣。有没有办法使用REGEX只匹配&#34; 39.64&#34;没有得到其余的HTML?
THX