Dim html As String
html = Downloadhtml(TextBox1.Text, "UTF-8") '获取url--HTML内容
Dim str As String
str = "<li class=""list-item"" data-sg=""False""><div class=""""></div><a class=""list1"" href=""(.+)"" target=""_blank""><img width=""200"" height=""200"" alt=""(\\s+)"" src=""(\\s+)""></a><a class=""list2"" href=""(\\s+)"" style=""display: block; with: 198px;"" target=""_blank"">(\\s+)</a><p class=""list3""><span class=""jg""><em class=""dol"">¥</em>(\\s+)</span><span class=""list_scj"">¥(\\s+)</span><span class=""list_zk"">((\\s+)折)</span> </p><p class=""list4""><a class=""pl_num product-comment-total-a027218"" target=""_blank"" href=""(\\s+)"" rel=""nofollow""><em></em>(\\s+)篇评价</a></p><p class=""list5""><a id=""buy_(\\s+)"" class=""shop"" href=""javascript:void(0);"" onclick=""ProductInfoObj.AddShopping(""(\\s+)"", ""list"")"">加入购物车</a><a class=""save"" href=""javascript:void(0);"" onclick="" ProductInfoObj.AddFavorite(""(\\s+)"", ""list"" );"">关注</a> </p></li>"
Dim matchess As MatchCollection
matchess = Regex.Matches(html, str, RegexOptions.IgnoreCase)
For Each m In matchess
ListBox1.Items.Add(m.Groups(1).Value)
Next
我获取到网页内容后,想用正则表达式来读取同样模板<div>中URL内容,但是这个str正则表达式规则不知道怎么写,请大神赐教。