7,763
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Sub Command1_Click()
Dim data$
data = "<a>http://www.baidu.com><span class=simple>s1</span></a>" & vbCrLf & _
"<a>http://www.sina.com><span class=simple>t2</span></a>" & vbCrLf & _
"<a>http://wx.txes.com><span class=simple>tr0</span></a>"
Dim reg As Object
Set reg = CreateObject("vbscript.regexp")
reg.Global = True
reg.ignorecase = True
reg.Pattern = "<a>.*><span class=simple>"
Dim matches
Set matches = reg.execute(data)
Dim match
For Each match In matches
Call MsgBox(match.Value)
Next
End Sub