Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 使用正则表达式提取链接_Regex_Vb.net_Visual Studio 2010 - Fatal编程技术网

Regex 使用正则表达式提取链接

Regex 使用正则表达式提取链接,regex,vb.net,visual-studio-2010,Regex,Vb.net,Visual Studio 2010,如何使用正则表达式提取所有链接 链接示例: <a class="link" title="somehing" href="https://www.website.com/link" data-jsid="anchor" target="_blank"> (more html stuff..) I want to this: https://www.website.com/link 你可以用像 href="([^"]+)" [^”]+匹配除“ 例如: 这里,capture g

如何使用正则表达式提取所有链接

链接示例:

<a class="link" title="somehing" href="https://www.website.com/link" data-jsid="anchor" target="_blank"> (more html stuff..)

I want to this: https://www.website.com/link

你可以用像

href="([^"]+)"
  • [^”]+
    匹配除
例如:

这里,capture groupo 1将包含字符串

https://www.website.com/link

您还可以使用非贪婪的
+?
作为

href=".+?"
例如:

你可以试试后面看

(?<=href=")([^"]+)
(?不带“href=”标签。如果可以的话,请只给我发与VB兼容的正则表达式。我的正则表达式很差。
(?<=href=")([^"]+)