uri.abnf 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
  2. hier-part = "//" authority path-abempty
  3. / path-absolute
  4. / path-rootless
  5. / path-empty
  6. URI-reference = URI / relative-ref
  7. absolute-URI = scheme ":" hier-part [ "?" query ]
  8. relative-ref = relative-part [ "?" query ] [ "#" fragment ]
  9. relative-part = "//" authority path-abempty
  10. / path-absolute
  11. / path-noscheme
  12. / path-empty
  13. scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
  14. authority = [ userinfo "@" ] host [ ":" port ]
  15. userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
  16. host = IP-literal / IPv4address / reg-name
  17. port = *DIGIT
  18. IP-literal = "[" ( IPv6address / IPvFuture ) "]"
  19. IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
  20. IPv6address = 6( h16 ":" ) ls32
  21. / "::" 5( h16 ":" ) ls32
  22. / [ h16 ] "::" 4( h16 ":" ) ls32
  23. / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
  24. / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
  25. / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
  26. / [ *4( h16 ":" ) h16 ] "::" ls32
  27. / [ *5( h16 ":" ) h16 ] "::" h16
  28. / [ *6( h16 ":" ) h16 ] "::"
  29. h16 = 1*4HEXDIG
  30. ls32 = ( h16 ":" h16 ) / IPv4address
  31. IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
  32. dec-octet = DIGIT ; 0-9
  33. / %x31-39 DIGIT ; 10-99
  34. / "1" 2DIGIT ; 100-199
  35. / "2" %x30-34 DIGIT ; 200-249
  36. / "25" %x30-35 ; 250-255
  37. reg-name = *( unreserved / pct-encoded / sub-delims )
  38. path = path-abempty ; begins with "/" or is empty
  39. / path-absolute ; begins with "/" but not "//"
  40. / path-noscheme ; begins with a non-colon segment
  41. / path-rootless ; begins with a segment
  42. / path-empty ; zero characters
  43. path-abempty = *( "/" segment )
  44. path-absolute = "/" [ segment-nz *( "/" segment ) ]
  45. path-noscheme = segment-nz-nc *( "/" segment )
  46. path-rootless = segment-nz *( "/" segment )
  47. path-empty = 0<pchar>
  48. segment = *pchar
  49. segment-nz = 1*pchar
  50. segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
  51. ; non-zero-length segment without any colon ":"
  52. pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
  53. query = *( pchar / "/" / "?" )
  54. fragment = *( pchar / "/" / "?" )
  55. pct-encoded = "%" HEXDIG HEXDIG
  56. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
  57. reserved = gen-delims / sub-delims
  58. gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
  59. sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
  60. / "*" / "+" / "," / ";" / "="