Operator | Meaning |
---|---|
= |
Defines a rule. Example: rule-name = value |
/ |
Logical OR (choice). Example: A / B means "A or B". |
* |
Zero or more occurrences. Example: *DIGIT means "0 or more DIGITs". |
1* |
One or more occurrences. Example: 1*DIGIT means "1 or more DIGITs". |
[ ] |
Optional (zero or one occurrence). Example: [DIGIT] means "optional DIGIT". |
() |
Grouping. Example: (A / B) SP means "A or B followed by a space". |
# |
Comma-separated list. Example: #DIGIT means "1+ DIGITs, separated by commas". |
ALPHA |
Any alphabetic character (A-Z, a-z). |
DIGIT |
Any numeric digit (0-9). |
HEXDIG |
Any hexadecimal digit (0-9, A-F). |
Term | Definition |
---|---|
SP |
Space (U+0020 ). |
HTAB |
Horizontal tab (U+0009 ). |
CR |
Carriage return (\r , U+000D). |
LF |
Line feed (\n , U+000A). |
CRLF |
Carriage return + line feed (\r\n ). |
OWS |
Optional Whitespace (*( SP / HTAB ) ). |
BWS |
Bad Whitespace (used for backward compatibility, trimmed during parsing). |
token |
Any sequence of visible ASCII characters except separators. |
quoted-string |
A string enclosed in double quotes (" ), allowing escapes with \ . |
field-name |
A token identifying a header field. Example: Content-Type . |
field-value |
The value of a header field, which can include tokens or a quoted string. |
Construct | ABNF Definition | Meaning |
---|---|---|
OWS |
*( SP / HTAB ) |
Zero or more spaces or tabs (optional whitespace). |
header-field |
field-name ":" OWS field-value OWS |
Header field definition (name, colon, value). |
method |
token |
HTTP request method (e.g., GET, POST). |
request-line |
method SP request-target SP HTTP-version CRLF |
First line of an HTTP request. |
status-line |
HTTP-version SP status-code SP reason-phrase CRLF |
First line of an HTTP response. |
absolute-URI |
Defined in RFC 3986. | Full URI (scheme, host, path, etc.). |