'引用了Microsoft VBScript Regular Expressions 5.5 Private Sub Command1_Click() Dim re As RegExp Dim mh As Match Dim mhs As MatchCollection Text1.Text = "" Source1 = Inet1.OpenURL("www.csdn.net") If Source1 <> "" Then Text1.Text = Source1 Me.Inet1.Cancel End If Set re = New RegExp re.Global = True re.Pattern = "http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?" Set mhs = re.Execute(Source1) For Each mh In mhs Debug.Print mh Next End Sub
分析源代码,用正则,最笨的办法是用instr搜索有没有http标记的
Private Sub Command1_Click()
Dim re As RegExp
Dim mh As Match
Dim mhs As MatchCollection
Text1.Text = ""
Source1 = Inet1.OpenURL("www.csdn.net")
If Source1 <> "" Then
Text1.Text = Source1
Me.Inet1.Cancel
End If
Set re = New RegExp
re.Global = True
re.Pattern = "http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"
Set mhs = re.Execute(Source1)
For Each mh In mhs
Debug.Print mh
Next
End Sub
就这个引用我找不到,vista ie7 绿色vb6.0
找到了 以解决,经测试可用~就是不懂的怎么使用~我在自己研究把`
谢谢SYSSZ(老张)的详细的回答 同时谢谢 xxyj6450(三断笛) asftrhgjhkjlkttttttt(孤独剑) jhone99(jhone) 准备结贴 送分 第一次提问 ,希望能顺利送出~~~