提取一篇报纸文章的作者(正则表达式问题)



我正试图在VB.Net中提取类似这两篇报纸文章的作者(我以为我可以使用正则表达式,但我没有找到可靠的方法(:

  1. https://www.faz.net/aktuell/wirtschaft/kein-brexit-chaos-an-grenze-zwischen-frankreich-und-grossbritannien-17130243.html

  2. https://www.nytimes.com/2021/01/04/world/europe/assange-extradition-denied.html

直到现在,我尝试过这个(针对文章1(:

Dim x As New WebClient()
Dim source As String = x.DownloadString("https://www.faz.net/aktuell/wirtschaft/kein-brexit-chaos-an-grenze-zwischen-frankreich-und-grossbritannien-17130243.html")
Dim pattern1 As String = Chr(34) & "author" & ":" & Chr(34) & "(.*)" & Chr(34) & ","
Dim m As Match = Regex.Match(source, pattern1)
MsgBox(m.Groups(0).ToString)

Mesagebox应该显示Philip Plickert的名称,但它什么也不返回。

有人能给我一个提示或代码告诉我如何做到这一点吗(我对正则表达式很陌生(?

请尝试以下模式:

/<a class="atc-MetaAuthorLink" href=".+">(.+)</font>/g

在这里玩:

https://regex101.com/r/GDOBLq/1

最新更新