Count repeats and options
04A repetition has inclusive bounds; brackets make the entire enclosed sequence optional.
1234 has four digits; it fails before any successful result, regardless of an optional suffix.
Source for this drawing: RFC 5234 · Read RFC section 3.6 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
a*b means at least a and at most b repetitions. Omitted lower bound means zero; omitted upper bound means no upper limit.
- a*b means at least a and at most b repetitions. Omitted lower bound means zero; omitted upper bound means no upper limit.
- nDIGIT means exactly n digits. Our 1*3DIGIT example accepts one, two or three ASCII digits.
- [foo bar] is zero or one occurrence of the whole foo bar sequence, equivalent to *1(foo bar); it is not a choice between foo and bar.
- The invented word = 1*3DIGIT ["!"] permits one optional exclamation mark after its digits. There is no implied whitespace.
Examples are invented ASCII strings, not a complete application protocol. Matching syntax does not establish application meaning or authorization. Core rules are in RFC5234 Appendix B.1; external encodings are separate (§2.4).
Read the RFC section ↗