regex for URL including query string

前端 未结 6 1599
谎友^
谎友^ 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 17:55

    Use the ABNF at the end of RFC3986 as a starting point to get it right.

    This uses them for URI validation in Python; not what you're looking for, but it should give an idea of the direction you should go in: http://gist.github.com/138549

提交回复
热议问题