RFC 5234 / START HERE
ABNF grammar, before the details
ABNF means Augmented Backus–Naur Form, a notation for writing syntax rules.
It describes which sequences of characters or numeric terminal values fit a named pattern. A grammar is the set of those rules; matching checks a candidate against them.
The idea in one picture
Written rule
Match the parts
Whole string
A simplified picture of the idea; the chapters explain the actual mechanisms.
Why it exists
Internet specifications need precise, reusable syntax. RFC5234 defines the notation and common core rules; RFC7405 later adds explicit case-sensitive strings. This guide teaches how to read those mechanisms, not how to build a complete parser.
A familiar example
An invented label rule can accept ID:42 while rejecting ID:4 because it requires two digits. A matching label still needs its application’s meaning and checks; grammar alone does not grant permission.
Helpful background
You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.
What you’ll learn next
Begin with chapter one, or choose a topic.
- Expand a named ruleA rule names a pattern; following its parts tells you which complete strings fit.→
- Match literals and numbersQuoted letters normally ignore ASCII case; numeric terminals choose exact values.→
- Group choices before joiningParentheses decide what belongs to an alternative; a slash does not insert a separator in data.→
- Count repeats and optionsA repetition has inclusive bounds; brackets make the entire enclosed sequence optional.→
- Make whitespace explicitWhitespace in the written rule does not automatically appear in the strings it describes.→
This introduction explains RFC 5234 (2008). Read the original RFC ↗