Visual RFC.
ALL RFCs / RFC 5234
Read the RFC ↗
RFC 5234 / READING ABNF

Count repeats and options

04

A repetition has inclusive bounds; brackets make the entire enclosed sequence optional.

RFC 5234 · § 3.6EXAMPLE
4 / 4
Count repeats and optionsA 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.Count a repeated elementword = 1*3DIGIT ["!"]12344 digits · allowed count 1–3Optional ! absentInput: 1234Stop: no matchNO MATCHRFC5234 · chapter 4 · state 4 · ASCII examples
04
Reject one too many

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 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
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.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

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.
DETAILS

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 ↗

All chapters in RFC 5234

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗