tech-invite   World Map     

IETF     RFCs     Groups     SIP     ABNFs    |    3GPP     Specs     Glossaries     Architecture     IMS     UICC    |    search     info

ABNF grammars

|   SIP_Messages   |   SIP_URIs   |   SIP_Headers   |   SIP_Private_Headers   |   SIP_Response_Codes   |   SIP_basic_rules   |   SIP_common_rules   |   SDP_Session_Description   |   SDP_Attributes   |   RFC723x_HTTP_1.1   |   RFC3986_Generic_URI   |   RFC3987_IRI   |   RFC5322_IMF   |   RFC4975_MSRP   |   draft2326bis_RTSP_2.0   |   RFC5234_ABNF_Notation   |

URI (Uniform Resource Identifier) Generic Syntax – RFC 3986

A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. The URI generic syntax, as defined in RFC 3986 (and updated by RFC 6874), is a superset of the syntax of all URI schemes. A parser of the generic URI syntax can parse any URI reference into its five major components. Once the scheme is determined, further scheme-specific parsing can be performed on the components.



URI Reference     Scheme     Authority     Path     Query     Fragment     Characters 

RFC 3986 – Section 3Section 4

Top

URI-reference   =
URI   /   relative-ref

URI   =
scheme   ":"   hier-part   [ "?"   query ]   [ "#"   fragment ]

absolute-URI   =
scheme   ":"   hier-part   [ "?"   query ]

relative-ref   =
relative-part   [ "?"   query ]   [ "#"   fragment ]

hier-part   =
relative-part   =

 



URI Reference     Scheme     Authority     Path     Query     Fragment     Characters 

RFC 3986 – Section 3.1

Top

scheme   =
ALPHA   *( ALPHA   /   DIGIT   /   "+"   /   "-"   /   "." )

; Examples:
;     "sip"
;     "sips"
;     "tel"
;     "http"
;     "https"
;     "mailto"
;     "pres"
;     "ftp"
;     "file"
;     "rtsp"
;     "msrp"

 



URI Reference     Scheme     Authority     Path     Query     Fragment     Characters 

RFC 3986 – Section 3.2

Top

authority   =
[ userinfo "@" ]   host   [ ":"   port ]

authority – userinfo

RFC 3986 – Section 3.2.1

Up

userinfo   =
*( unreserved   /   pct-encoded   /   sub-delims   /   ":" )

authority – host

RFC 3986 – Section 3.2.2

RFC 6874 – Section 2

Up

host   =
IP-literal   /   IPv4address   /   reg-name

IP-literal   =
"["   ( IPv6address   /   IPv6addrz   /   IPvFuture )   "]"

IPv6addrz   =
IPv6address   "%25"   ZoneID     ;  see   RFC 6874
ZoneID   =
1*( unreserved   /   pct-encoded )

IPvFuture   =
"v"   1*.   "."   1*( unreserved   /   sub-delims   /   ":" )

IPv6address   =
                                             6( h16   ":" )   ls32   /
                                     "::"   5( h16   ":" )   ls32   /
[                        h16 ]   "::"   4( h16   ":" )   ls32   /
[ *1( h16   ":" )   h16 ]   "::"   3( h16   ":" )   ls32   /
[ *2( h16   ":" )   h16 ]   "::"   2( h16   ":" )   ls32   /
[ *3( h16   ":" )   h16 ]   "::"       h16   ":"     ls32   /
[ *4( h16   ":" )   h16 ]   "::"                        ls32   /
[ *5( h16   ":" )   h16 ]   "::"       h16   /
[ *6( h16   ":" )   h16 ]   "::"

h16   =
1*4HEXDIG
ls32   =
( h16   ":"   h16 )   /   IPv4address

IPv4address   =
dec-octet   "."   dec-octet   "."   dec-octet   "."   dec-octet

dec-octet   =
DIGIT   /     ;  0-9
%x31-39   DIGIT   /     ;  10-99
"1"   2DIGIT   /     ;  100-199
"2"   %x30-34   DIGIT   /     ;  200-249
"25"   %x30-35     ;  250-255

reg-name   =
*( unreserved   /   pct-encoded   /   sub-delims )

authority – port

RFC 3986 – Section 3.2.3

Up

port   =

 



URI Reference     Scheme     Authority     Path     Query     Fragment     Characters 

RFC 3986 – Section 3.3

Top

path   =
path-abempty   /     ;  begins with "/" or is empty
path-absolute   /     ;  begins with "/" but not "//"
path-noscheme   /     ;  begins with a non-colon segment
path-rootless   /     ;  begins with a segment
path-empty     ;  zero characters

path-abempty   =
*( "/"   segment )

path-absolute   =
"/"   [   segment-nz   *( "/"   segment )   ]

path-noscheme   =
segment-nz-nc   *( "/"   segment )

path-rootless   =
segment-nz   *( "/"   segment )

path-empty   =
0<pchar>

segment   =
segment-nz   =
1*pchar

segment-nz-nc   =
1*( unreserved   /   pct-encoded   /   sub-delims   /   "@" )
;  non-zero-length segment without any colon ":"

pchar   =
unreserved   /   pct-encoded   /   sub-delims   /   ":"   /   "@"

 



URI Reference     Scheme     Authority     Path     Query     Fragment     Characters 

RFC 3986 – Section 3.4

Top

query   =
*(  pchar   /   "/"   /   "?"  )

 



URI Reference     Scheme     Authority     Path     Query     Fragment     Characters 

RFC 3986 – Section 3.5

Top

fragment   =
*(  pchar   /   "/"   /   "?"  )

 



URI Reference     Scheme     Authority     Path     Query     Fragment     Characters 

RFC 3986 – Section 2

Top

pct-encoded   =
"%"   HEXDIG   HEXDIG

unreserved   =
ALPHA   /   DIGIT   /   "-"   /   "."   /   "_"   /   "~"

reserved   =
gen-delims   =
":"   /   "/"   /   "?"   /   "#"   /   "["   /   "]"   /   "@"

sub-delims   =
"!"   /   "$"   /   "&"   /   " ' "   /   "("   /   ")"   /   "*"   /   "+"   /   ","   /   ";"   /   "="