It's official #PHP8.5 will get not one but two URI/URL compliant parsers 🎉 https://externals.io/message/127317#127422 #RFC3986 #WHATWG-URL
Good job by @kocsismate90
It's official #PHP8.5 will get not one but two URI/URL compliant parsers 🎉 https://externals.io/message/127317#127422 #RFC3986 #WHATWG-URL
Good job by @kocsismate90
#LeagueURI will expose the methods from the upcoming native PHP URI interface to allow easier upgrade to using PHP URI native extension when it will be released https://github.com/thephpleague/uri-src/issues/148 comments and remarks are welcomed in the PR. #uri #rfc3986 #rfc3987
URI Templates #RFC6570 and Media Fragments #RFC3986 gives developers #NOCODE programmable hypermedia linking without needing a webbrowser/scripting engine:
://{chapter}.mp3#t={time}
Lots of interesting opportunities for (file) metadata adopting them.
A HTML5 webbrowser-implementation is not the soul of 'a common web', it's the URI's in any shape or form (jusk ask interpeer.io)
@nabijaczleweli by the way:
perl -lne 'print $& while m'\''([A-Za-z][0-9A-Za-z+.-]*):(?://((?:(?:[0-9A-Za-z._~!$&-,;=:-]|%[0-9A-Fa-f]{2})*@)?(?:(?:[0-9A-Za-z._~!$&-,;=-]|%[0-9A-Fa-f]{2})*|\[[0-9A-Za-z._~!$&-,;=:-]+\])(?::[0-9]*)?)(?=[/?#]|$)|(?!//))((?:[0-9A-Za-z._~!$&-,;=:@/-]|%[0-9A-Fa-f]{2})*)(?:\?((?:[0-9A-Za-z._~!$&-,;=:@/?-]|%[0-9A-Fa-f]{2})*))?(?:#((?:[0-9A-Za-z._~!$&-,;=:@/?-]|%[0-9A-Fa-f]{2})*))?'\'g\; filename […]
This also extracts all URIs (per RFC 3986, but the validity of hostnames/IPs or that the strings after percent-decoding are valid UTF-8 is not checked).
@amin @rl_dane in case you ever need a regexp to match all URIs in a string. (Surround with ^
and $
to check one for validity.)
Capture groups:
$1
= scheme$2
= authority (use m/^(?:([^@]*)@)?(.*?)(?::([0-9]*))?$/
to split this further into $1
=userinfo $2
=host $3
=port)$3
= path$4
= query$5
= fragment