请问高手有没有简便有效的办法处理这些
[color=#FF0000][/color]<td width=380>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF"> <font face="Arial" size="2">Going : </font></td>
<td colspan="4" bgcolor="#FFFFFF"><font face="Arial" size="2">Good</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> <font face="Arial" size="2">Course :</font></td>
<td colspan="4" bgcolor="#FFFFFF"><font face="Arial" size="2">AWT</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<font face="Arial" size="2">RaceTime : </font></td>
<td bgcolor=#FFFFFF><font face="Arial" size=2>(28.81)</font></td><td bgcolor=#FFFFFF><font face="Arial" size=2>(52.12)</font></td><td bgcolor=#FFFFFF><font face="Arial" size=2>(1.16.12)</font></td><td bgcolor=#FFFFFF><font face="Arial" size=2>(1.40.05)</font></td> </tr>
<tr>
<td bgcolor="#FFFFFF"><font face="Arial" size="2">Sectional Time : </font></td>
<td bgcolor=#FFFFFF><font face="Arial" size=2>28.81</font></td><td bgcolor=#FFFFFF><font face="Arial" size=2>23.31</font></td><td bgcolor=#FFFFFF><font face="Arial" size=2>24.00</font></td><td bgcolor=#FFFFFF><font face="Arial" size=2>23.93</font></td></tr></table>
</td></tr></table>
<p>
<table width="760" border="0" cellspacing="1" class=bigborder cellpadding="0">
<tr>
<td>
<table width="760" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="13" valign=top class=resultsubheader width=5%>
<div align="center">Plc.</div>
</td>
<td height="13" valign=top class=resultsubheader width=5%>
<div align="center">Horse No.</div>
</td>
<td height="13" valign=top class=resultsubheader width=20%>
<div align="center">Horse</div>
</td>
<td height="13" valign=top class=resultsubheader width=10%>
<div align="center">Jockey</div>
</td>
<td height="13" valign=top class=resultsubheader width=10%>
<div align="center">Trainer</div>
</td>
<td height="13" valign=top class=resultsubheader width=5%>
<div align="center">Actual Wt.</div>
</td>
<!--ss06_2 -start-->
<td height="13" valign=top class=resultsubheader width=5%>
<div align="center">Declar.<br>Horse Wt.<!--On Day Horse Wt.--></div>
</td>
<!--ss06_2 -end-->
<td height="13" valign=top class=resultsubheader width=5%>
<div align="center">Draw</div>
</td>
<td height="13" valign=top class=resultsubheader width=5%>
<!--ss12 -start-->
<div align="center">LBW</div>
<!--ss12 -end-->
</td>
<td height="13" valign=top class=resultsubheader width=5%>
<DIV align=center>Running<br>Position</DIV>
</td>
<td height="13" valign=top class=resultsubheader width=5%>
<!--ss12 -start-->
<div align="center">Time</div>
<!--ss12 -end-->
</td>
<td height="13" valign=top class=resultsubheader width=5%>
<div align="center">Win Odds</div>
</td>
</tr>
font class=htable_eng_rg_text>14</font></td><tr bgcolor="#FFFFFF"><td align=center class=htable_eng_rg_text><font class=htable_eng_rg_text>4 </font></td><td align=center class=htable_eng_rg_text><font class=htable_eng_rg_text>5</font></td><td><font class=htable_eng_link_text><a class=htable_eng_link_text href=horse.asp?horseno=J272>ICE FIRE </a>(J272) </font></td><td width=110><a class=htable_eng_link_text href="jockeyprofile.asp?jockeycode=PB&season=Current"><font face="Arial" size=2>B Prebble </font></a></td><td><font class=htable_eng_link_text ><a class=htable_eng_link_text href="trainerprofile.asp?trainercode=NTK&season=Current">T K Ng </a></td><td align=center><font class=htable_eng_rg_text>128</font></td><td align=center><font class=htable_eng_rg_text>1084</font></td><td align=center><font class=htable_eng_rg_text>3</font></td><td align=center><font class=htable_eng_rg_text>2-1/4 </font></td><td align=center><table border=0 cellspacing=0 cellpadding=0 width=64><tr><td align=center width=16 class=htable_eng_rp_text>4</td><td align=center width=16 class=htable_eng_rp_text>4</td><td align=center width=16 class=htable_eng_rp_text>5</td><td align=center width=16 class=htable_eng_rp_text>4</td></tr></table></td><td align=center><font class=htable_eng_rg_text>1.40.40</font></td><td align=center><font class=htable_eng_rg_text>4.2</font></td><tr bgcolor="#EEEEEE"> <td align=center class=htable_eng_rg_text><font class=htable_eng_rg_text>5 </font></td><td align=center class=htable_eng_rg_text><font class=htable_eng_rg_text>1</font></td><td><font class=htable_eng_link_text><a class=htable_eng_link_text href=horse.asp?horseno=J307>EPEE DE HUA </a>(J307) </font></td><td width=110><a class=htable_eng_link_text href="jockeyprofile.asp?jockeycode=CML&season=Current"><font face="Arial" size=2>M Chadwick </font></a></td><td><font class=htable_eng_link_text ><a class=htable_eng_link_text href="trainerprofile.asp?trainercode=MA&season=Current">A T Millard </a></td><td align=center><font class=htable_eng_rg_text>131</font></td><td align=center><font class=htable_eng_rg_text>1076</font></td><td align=center><font class=htable_eng_rg_text>1</font></td><td align=center><font class=htable_eng_rg_text>2-3/4 </font></td><td align=center><table border=0 cellspacing=0 cellpadding=0 width=64><tr><td align=center width=16 class=htable_eng_rp_text>7</td><td align=center width=16 class=htable_eng_rp_text>7</td><td align=center width=16 class=htable_eng_rp_text>8</td><td align=center width=16 class=htable_eng_rp_text>5</td></tr></table></td><td align=center><font class=htable_eng_rg_text>1.40.50</font>
就像这段一样,我要截取的都是红色部分,就是说<>***<>这种星号的内容,小弟也想到的截取办法,但是实在有点不好意思拿出来献丑(非常非常笨的方法),不知道哪位高手能用正则或者简单的方法,截取后提交到数组呢,?谢谢了。
[解决办法]
Private Function StrFormat(s As String) As StringOn Error Resume NextDim Buf As StringDim StrTemp As StringDim c As StringDim i As LongDim j As LongDim k As LongDim L As Long Buf = s Do L = InStr(1, Buf, "<style", vbTextCompare) If L > 0 Then k = InStr(L + 6, Buf, "</style>", vbTextCompare) If k > 0 Then Buf = Left(Buf, L - 1) + Mid(Buf, k + 8) Else Buf = Left(Buf, L - 1) Exit Do End If Else Exit Do End If Loop Do L = InStr(1, Buf, "<script", vbTextCompare) If L > 0 Then k = InStr(L + 7, Buf, "</script>", vbTextCompare) If k > 0 Then Buf = Left(Buf, L - 1) + Mid(Buf, k + 9) Else Buf = Left(Buf, L - 1) Exit Do End If Else Exit Do End If Loop Buf = Replace(Buf, "&", "&") Buf = Replace(Buf, """, Chr(34)) '替换成双引号 Buf = Replace(Buf, "<", "<") Buf = Replace(Buf, ">", ">") Buf = Replace(Buf, " ", "") Buf = Replace(Buf, "<", " <") Buf = Replace(Buf, ">", "> ") Buf = Replace(Buf, " ", "") Buf = Replace(Buf, Chr(26), " ") Buf = Replace(Buf, Chr(10), " ") Buf = Replace(Buf, Chr(9), " ") Buf = Replace(Buf, Chr(13), " ") Buf = LTrim(Buf) Buf = RTrim(Buf) '您可加入其他替换 StrTemp = "" For i = 1 To Len(Buf) c = Mid(Buf, i, 1) Select Case c Case "<" If i <> 1 Then StrTemp = StrTemp & Mid(Buf, j + 1, i - j - 1) End If Case ">" j = i End Select Next i L = Len(StrTemp) Do Buf = Replace(StrTemp, " ", " ") i = Len(Buf) If i = L Then Exit Do L = i StrTemp = Buf Loop StrFormat = BufEnd Function
[解决办法]