Core rulesΒΆ
Every Rule subclass is initialized with the RFC 5234 core rules, so they are
available by name in any grammar without being redefined:
from abnf import Rule
Rule("ALPHA") # already defined in every Rule subclass
Rule |
ABNF definition |
Matches |
|---|---|---|
|
|
|
|
|
a binary digit |
|
|
any 7-bit US-ASCII character except NUL |
|
|
carriage return |
|
|
Internet standard newline |
|
|
control characters |
|
|
|
|
|
the double-quote |
|
|
a hexadecimal digit |
|
|
horizontal tab |
|
|
line feed |
|
|
linear white space (see the RFC 5234 caveat) |
|
|
any 8-bit byte |
|
|
a space |
|
|
any visible (printing) character |
|
|
a space or horizontal tab |
Note
HEXDIG matches the hexadecimal letters case-insensitively, per the ABNF
convention that literal strings are case-insensitive unless declared otherwise
(see Architecture: parser combinators and RFC 7405).