regex for URL including query string

前端 未结 6 1598
谎友^
谎友^ 2020-12-10 17:21

I thought this would be a simple google search but apparently not. What is a regex I can use in C# to parse out a URL including any query string from a larger text

6条回答
  •  抹茶落季
    2020-12-10 18:05

    Sorry I'm not yet able to add comments, but would like to point out that P Daddy's answer requires a little tweaking:

    @"(https?|ftp|file)\://[a-zA-Z0-9\.\-]+(/[a-zA-Z0-9\?\&\=;\+!'\(\)\*\-\._~%]*)*"
    

提交回复
热议问题