1

ここで初心者を助けてください。フォーラムの投稿から重複したコンテンツをチェックしようとしています。これまでのところ、webclient を使用してソースをダウンロードし、正規表現と mshtml を試してみましたが、うまくいきませんでした。私は mshtml で行を取得していますが、私が望んでいた方法ではありません。つまり、個々のコメントを分離できないということです。私が読もうとしているソースは以下のとおりです。

<p>
    Hey Alton!</p>
<p>
    I am facing this problem also but i have search on the internet for the solution. There are few things that we need to do to solve this problem.</p>
<p>
    First of all make sure that you have latest drivers for you Graphics Card.</p>

これまでに試したコード

正規表現:

    Dim r As New System.Text.RegularExpressions.Regex("<p> .* </p>")
    Dim matches As MatchCollection = r.Matches(result)
    For Each itemcode As Match In matches
        ListBox1.Items.Add(itemcode.ToString)
    Next
4

1 に答える 1

0
Dim regexObj As New Regex("<p>(.+?)</p>", RegexOptions.Singleline)
Dim matchResults As Match = regexObj.Match(subjectString)
While matchResults.Success

matchResults = matchResults.NextMatch()
End While
于 2013-03-26T13:56:53.587 に答える