Regular expression for parsing links from a webpage?

前端 未结 9 726
南旧
南旧 2020-11-27 20:02

I\'m looking for a .NET regular expression extract all the URLs from a webpage but haven\'t found one to be comprehensive enough to cover all the different ways you can spec

9条回答
  •  我在风中等你
    2020-11-27 20:49

    This will capture the URLs from all a tags as long as the author of the HTML used quotes:

    ]+href="([^"]+)"[^>]*>
    

    I made an example here.

提交回复
热议问题