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

前端 未结 4 1398
无人及你
无人及你 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:38

    Thanks ircmaxell but I had to adjust a little the IPV6 regex for PHP to compile with preg_match.

    I changed:

    $ipv6 = "([({$rawIpv6}|{$ipv4sub})])";
    

    To :

    $ipv6 = "({$rawIpv6}|{$ipv4sub})";
    

提交回复
热议问题