7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub TestReg()
Dim strData As String
Dim reg As Object
Dim matchs As Object, i As Integer, j As Integer
strData = "网页代码"
Set reg = CreateObject("vbscript.regExp")
reg.Global = True
reg.IgnoreCase = False
reg.MultiLine = True
reg.Pattern = ">([^><]+)</TD>[\s\S]*?>([^><]+)</TD>[\s\S]*?>([^><]+)</TD>[\s\S]*?>([^><]+)</TD>[\s\S]*?>([^><]+)</TD>[\s\S]*?>([^><]+)</TD>"
Set matchs = reg.Execute(strData)
For i = 0 To matchs.Count - 1
For j = 0 To matchs(i).SubMatches.Count - 1
Debug.Print "(" & j + 1 & ")." & matchs(i).SubMatches(j) & " ";
Next
If matchs(i).SubMatches.Count > 0 Then Debug.Print
Next
End Sub
Private Sub TestReg()
Dim strData As String
Dim reg As Object
Dim matchs As Object, i As Integer, j As Integer
strData = "网页源代码"
Set reg = CreateObject("vbscript.regExp")
reg.Global = True
reg.IgnoreCase = False
reg.MultiLine = True
reg.Pattern = ">([^><]+)</TD>"
Set matchs = reg.Execute(strData)
For i = 0 To matchs.Count - 1
For j = 0 To matchs(i).SubMatches.Count - 1
Debug.Print "(" & j + 1 & ")." & matchs(i).SubMatches(j) & " ";
Next
If matchs(i).SubMatches.Count > 0 Then Debug.Print
Next
End Sub
<TD class=STYLE7 [^<>]*>([^<>]+)</TD>
>([^><]+)</TD>