First, format description
"|" Indicates that one of the two parts can only appear one, and the representation of square brackets [] can be selected, the text is brought by double quotation marks "", at least n or more, N The default is 0.
Second, the overall format
GenericURL = Scheme ":" Schemepart
Scheme = 1 * [Lowalpha | Digit | "|" - "|". "] schemepart = * xchar | ip-schemepart
IP-Schemepart = "//" Login ["/" urlpath] login = [user ":" password] "@"] hostporthostport = host [":" port] host = hostname | Hostnumberhostname = * [domainlabel "." ] toplabeldomainlabel = alphadigit | alphadigit * [alphadigit | "-"] alphadigittoplabel = alpha | alpha * [alphadigit | "-"] alphadigitalphadigit = alpha | "." digithostnumber = digits digits digits digitsport = digitsuser = * "." "." [UCHAR | ";" |? "|" = "] password = * [uchar |"; "|?" | "&" | "="] urlpath = * xchar; Depends on protocol see Section 3.1
Third, common scheme
FTP (see RFC959) ftpurl = "ftp: //" login ["/" fpath ["; type =" ftptype]] fpath = fsegment * ["/" fsegment] fSEGMENT = * [uchar | "?" | | : "|" @ "|" = "ftptype =" a "|" i "|" d "|" a "|" i "|" d "
FILEFILEURL = "file: //" [Host | "LocalHost"] "/" fpath
Httphttpurl = "http: //" Hostport ["/" HPATH ["" Search] HPath = HSEGMENT * ["/" hsegment] hsegment = * [uchar | ";" | "|" @ "| "&" | "="] search = * [uchar | ";" | "|" @ "|" & "|" = "]; gopher (see RFC1436) GopherURL =" gopher: // "Hostport [ / [gtype [selector ["% 09" Search ["% 09" Gopher _String]]]] gtype = xcharselector = * xChargopher _String = * xchar
Mailto (see RFC822)
Mailtourl = "Mailto:" Encoded822addrencoded822addr = 1 * xChar; further defined in RFC822
News (see RFC1036) NewsURL = "News:" GroupPartGroupPart = "*" | group | articlegroup = alpha * [alpha | DIGIT | "-" | "." | " " | "_"] Articles = 1 * [ Uchar | ";" | "/" | "|": "" & "| ="] "@" Host
NNTP (see RFC977) nntpurl = "nntp: //" hostport "/" group ["/" DIGITS]
TelnettelnetURL = "telnet: //" login ["/"]
WAIS (see RFC1625) Waisurl = Waisdatabase | WaisIndex | Waisdocwaisdatabase = "WAIS: //" Hostport "/" DatabaseWaisIndex = "WAIS: //" Hostport "/" Database "?" Searchwaisdoc = "WAIS: //" Hostport " / "database" / "wtype" / "wpathDatabase = * ucharwtype = * ucharwpath = * uchar
; Prospero: // "hostport" / "ppath * [fieldspec] ppath = psegment * [" / "psegment] psegment = * [uchar |"? "|": "| @" | "&" | "=" = "=" = "|": ""? "": "" ""? "" "" @ "|" & "] Four, miscellaneous
Lowalpha = "a" | "B" | "C" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "q" | "r" | "s" | "u" | "v" | "w" | "x" | "Y "|" Z "HiALPHA =" A "|" B "|" D "|" e "|" f "|" g "|" h "|" i "|" j "|" k " | "L" | "M" | "N" | "q" | "r" | "s" | "t" | "u" | "v" | "W" | " X "|" y "|" z "
Alpha = Lowalpha | HiAlPhadigit = "0" | "1" | "2" | "4" | "5" | "6" | "7" | "8" | "9" Safe = "$" "-" | "_" | "|" * "|" "|" "|" | "," national = "{" | "}" | "| |" | ^ "|" ~ "|" [""] "|" "" = "<" | ">" "#" | "%" | <"> reserved = ";" | "/" | "|": "|" = "hex = DIGIT |" a "|" b "|" c "|" D "|" e "|" F "|" a "|" B "|" c "|" d "|" f "escape ="% "HEX HEX
Unreserved = alpha | DIGIT | SAFE | EXTRAUCHAR = unreserved | escapexchar = unreserved | reserved | escapedigits = 1 * DIGIT
Repost: http://blog.codelphi.com/nosound/archive/2004/12/09/30786.aspx