<td id="matchtime_115287" indexofmatch="8" matchtime="" nowrap>
03:45
</td> <td id="matchtime_115288" indexofmatch="9" matchtime="" nowrap>
03:45
</td>
以上源码中如何用正则表达式取出时间(03:45)??这段源码分开了三行。
03:45
</td> <td id="matchtime_115288" indexofmatch="9" matchtime="" nowrap>
03:45
</td>
以上源码中如何用正则表达式取出时间(03:45)??这段源码分开了三行。
解决方案 »
- 有关一个VB文本加密的问题!
- 如何只打印picturebox控件的内容?
- 怎么样改变用VB编出来的程序(以及应用程序)窗体左上角的VB图标?
- VB6.0怎样挂DB2?
- 发传真的问题!我已经试过用MAPI与FaxCom中类发传真都不行. 急!!几年了,还没有一个完整的答案,在线等候.
- 请教高手(关于背景)
- 用VB6的Data Report报表设计器与数据环境DataEnvironment绑定后的一个高难度打印问题.60求助
- 关于调用DLL后长时间运行而引的系统忙的问题如何解决?
- 续:笔画查询
- 请问如何在自己编写的收发e-mail程序
- 哪位大哥能够帮我将下面的C语言翻译为VB呀?急
- 用VB写DLL,怎样传送字符串返回值?
如果是asp.net ,可以使用lable显示时间,然后通过取lable的value应该可以取的。
str="<td id='matchtime_115287' indexofmatch='8' matchtime='' nowrap>
03:45</td><td id='matchtime_115288' indexofmatch='9' matchtime='' nowrap>
03:45</td>"
a=split(str,"</td>")
for i= 0 to ubound(a)-1
a(i)=RemoveHTML(ai)
'在这写上输出a(i)就是时间喽~~~
next i
'======RemoveHTML函数 去除html代码 用到了正则表达式
function RemoveHTML(fString)
dim re
set re = New RegExp
re.Global = True
re.IgnoreCase = True
if not isnull(fString) then
re.Pattern = "<(.[^>]*)>"
fString = re.Replace(fString,"")
fString=replace(fString," ","")
fString=replace(fString,vbBack,"")
fString=replace(fString,vbTab,"")
fString=replace(fString,vbLf,"")
fString=replace(fString,vbCr,"")
fString=replace(fString,vbCrLf,"")
RemoveHTML = trim(fString)
end if
end function
"<td id="matchtime_115287" indexofmatch="8" matchtime="" nowrap>
03:45
</td>
"
进行分析的,具体根据你的数据结构来写政则就行了.
Function GetDate(String)
Dim reg as New RegExp
reg.Global = True
reg.IgnoreCase = True
reg.Multiline = Truereg.Pattern = "<.+>(.+)<\/.+>"
GetDate = reg.Replace(String,"$1")
End Function
Dim reg As New RegExp
Dim str1 As String
Dim MC As Object
Dim m As Object
reg.IgnoreCase = True
reg.Global = True
reg.MultiLine = True
str1 = "<td id='matchtime_115287' indexofmatch='8' matchtime='' nowrap>03:45</td><td id='matchtime_115288' indexofmatch='9' matchtime='' nowrap>03:45</td>"
reg.Pattern = "<td (.*?)>(.*?)</td>"
Set MC = reg.Execute(str1)
For Each m In MC
MsgBox m.SubMatches(1)
Next
p.Global=True
p.IgnoreCase=True
p.MultiLine=True
p.Pattern="\d{2}\:\d{2}"
p.Execute strSource
Dim i
For Each i In p.Matches
Resposne.Write i
Next