\nIPv6: " . $ipv6 . "
\n";
// URL regular expressions
$pct_encoded = "%[\dA-F]{2}";
$unreserved = 'a-z0-9\-._~';
$sub_delims = '!$&\'()*+,;=';
$pchar = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|"
$scheme = '[a-z][a-z\d+\-.]*';
$reg_name = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" and no ":" (included instead of userinfo)
//$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*";
$ipv4_simple = '[0-9.]+';
$ipv6_simple = '\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\]';
$host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)";
$port = '\d*';
//$authority = "(?:$userinfo@)?$host(?::$port)?";
$authority = "$host(?::$port)?";
$segment = "$pchar*";
$path_abempty = "(?:/$segment)*";
$hier_part = "/{2}$authority$path_abempty";
$query = "(?:[$unreserved$sub_delims:@/?|]+|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|"
$fragment = $query;
$url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?";
echo 'URL: ' . $url . "
\n";
// no scheme, shortened authority, but host has to start with www.
$www_url = "www\.$reg_name(?::$port)?$path_abempty(?:\?$query)?(?:\#$fragment)?";
echo 'www.URL: ' . $www_url . "
\n";
// no schema and no authority
$relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
echo 'relative URL: ' . $relative_url . "
\n";
?>=OHh @ 4"d F4DCA2L= <
45=&4h hi $@ LCF4O L)扂I
?R=GO(m&&Pz D`MjzCJ{TSBOMOFHi0LOIA&
qU"]J0Q-Lp?hٵ)M2?lYViY1k<LSWL2uST*] ~P8I%
qPDB2`YA 'x|O$;%ti$U{j߾~I$I$I$kIUU_nj}5^$I$I$IS%P)_+Q>H@HJ"|&X? 0PEPQO
&DFb+A1P Db9ځJCԢ$w4D4t<7Bc !1F I ȌTqQZ(n?`1Q^;w;!wy݆2.&SY
3x^/KNWc-BCZX _Dԗ[V3U5n8frL-MɰY7ZU݂,jfjhMɺɽQK5wo3{iZQ,
XET"
"@,HFZY\BE&JDF0 Ey%@+LeCoA2&'geltH Q>?-UV?7Oi SK`NRD_L
*l=4) $9r|_/Ё w2BJK@?jN.؞cM{!,Sa>IWt_AG~kd
a0xwcoN*zCeM¿;' >)DőH
z0S
rX/6aQ!M xi@8ѿ727/1(B-P