7,763
社区成员
发帖
与我相关
我的任务
分享
'此代码由“正则测试工具 v1.1.43”自动生成,请直接调用TestReg过程
Private Sub TestReg()
Dim strData As String
Dim reg As Object
Dim matchs As Object, i As Integer, j As Integer
strData = "<td>楼主</td>"
Set reg = CreateObject("vbscript.regExp")
reg.Global = True
reg.IgnoreCase = True
reg.MultiLine = True
reg.Pattern = "<td[^>]*>(.*?)</td>"
Set matchs = reg.Execute(strData)
For i = 0 To matchs.Count - 1
Debug.Print i + 1 & "." & matchs(i)
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