RosettaCodeData/Task/URL-decoding/Perl-6/url-decoding-1.pl6

6 lines
132 B
Raku

my $url = "http%3A%2F%2Ffoo%20bar%2F";
say $url.subst: :g,
/'%'(<:hexdigit>**2)/,
-> ($ord ) { chr(:16(~$ord)) }