繁体   English   中英

使用vb.net为此源使用合适的正则表达式吗?

[英]Appropriate Regex for this source using vb.net?

在这里帮助新手。 我正在尝试检查论坛帖子中的重复内容。 到目前为止,我已经通过webclient下载了源代码,并尝试了Regex和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
Dim regexObj As New Regex("<p>(.+?)</p>", RegexOptions.Singleline)
Dim matchResults As Match = regexObj.Match(subjectString)
While matchResults.Success

matchResults = matchResults.NextMatch()
End While

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM