What is the RFC compliant and working regular expression to check if a string is a valid URL

前端 未结 4 1397
无人及你
无人及你 2020-12-06 10:04

There is question by the almost the same name already: What is the best regular expression to check if a string is a valid URL

I don\'t understand this stackoverflow

4条回答
  •  爱一瞬间的悲伤
    2020-12-06 10:53

    Here's RFC that you can study: RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax. Section 3.2.2 Host is what you're looking for.

    Unfortunately PHP's build-in function filter_var() doesn't support IPv6 syntax:

提交回复
热议问题