Regular expression for parsing links from a webpage?

前端 未结 9 735
南旧
南旧 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:44

    ((mailto\:|(news|(ht|f)tp(s?))\://){1}\S+)
    

    I took this from regexlib.com

    [editor's note: the {1} has no real function in this regex; see this post]

提交回复
热议问题