我試圖捕獲正在重複的HTML頁面中的網址,並且它通常在網址位於不同行時起作用,但在這種情況下,它們全部顯示在一行和單獨的行中。 URL具有標籤: HTTP://東西/ profile文件「> 這是我一直在努力使用正則表達式匹配重複組
Dim regex As Regex = New Regex(_
".*<a.*href='http://(?<Link>.*?)/profile'>", _
RegexOptions.IgnoreCase _
Or RegexOptions.CultureInvariant _
Or RegexOptions.IgnorePatternWhitespace _
Or RegexOptions.Compiled _
)
Dim ms As MatchCollection = regex.Matches(_html)
Dim url As String = String.Empty
For Each m As Match In ms
url = m.Groups("Link").Value.ToLower
讚賞任何想法。
非常感謝您的回覆,我會考慮在未來的程序中應用此代替正則表達式 – vbNewbie 2010-03-16 14:24:01