#! /usr/bin/env false use v6.d; unit grammar URL::Grammar; token TOP { [ ":" ]? "//"? [ "@" ]? ? ? [ "?" ]? [ "#" ]? } token scheme { <[ a..z ]> <[ a..z 0..9 . + - ]>* } token userinfo { [ ":" ] } token username { <-[ : @ ]>+ } token password { <-[ @ ]>+ } token host { [ ":" ]? } token hostname { [ <-[ / : # ? \h ]>+ | "[" <-[ \] ]>+ "]" ] } token port { \d ** 1..5 } token path { "/" * % "/" } token path-part { <-[ / ? # ]>+ } token query { * % "&" } token query-part { "=" } token query-part-key { <-[ = # & ]>+ } token query-part-value { <-[ # & ]>+ } token fragment { <-[ \s ]>+ } =begin pod =NAME URL::Grammar =AUTHOR Patrick Spek =VERSION 0.1.0 =head1 Synopsis =head1 Description =head1 Examples =head1 See also =end pod # vim: ft=perl6 noet