Visual RFC.
ALL RFCs / RFC 4647
Read the RFC ↗
RFC 4647 / LANGUAGE MATCHING

Keep basic prefix matches

02

Filtering returns all matching labels, possibly none. Basic filtering checks an exact label or a prefix ending at a whole-subtag boundary. It does not search inside a tag.

RFC 4647 · § 3.3.1EXAMPLE
4 / 4
04
Exclude the near misses

de-Deva fails the boundary check. de-Latn-DE fails the required prefix sequence. Two labels remain, rather than one chosen winner.

Keep basic prefix matchesde-Deva fails the boundary check. de-Latn-DE fails the required prefix sequence. Two labels remain, rather than one chosen winner.Basic range: de-DEde-DEkeepde-DE-1996keepde-Devaexcludede-Latn-DEexcludeResult: de-DE / de-DE-1996

Key idea: A matching basic prefix must end just before a hyphen, not partway through a subtag.

Terms
Basic filtering
Return every label that equals a range or extends it at a hyphen boundary.
Result set
All qualifying items, including an empty set when none qualify.

Look up a term in the glossary ↗

Rules & examples
  • Compare without case distinctions. A basic range matches when it equals the tag, or equals a prefix whose next character is a hyphen.
  • de-DE matches de-DE and de-DE-1996. It does not match de-Deva, where the apparent prefix ends inside Deva, or de-Latn-DE, where Latn intervenes.
  • The basic range * matches any tag under these rules. A using protocol MAY add wildcard semantics; this is not a complete HTTP Accept-Language negotiator.
  • Filtering returns a set, not one preferred item. The using application MAY leave the result unordered. String prefix similarity need not mean mutual comprehension.

The finite candidate set follows the RFC examples. Display order is illustrative; HTTP weights, exclusions, translation and language-tag validation are outside this comparison.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

Requested languages and available labels

Imagine a catalog of labeled documents. A filter keeps all labels that fit a pattern; a lookup tries preferences and returns one exact label or a defined default. Neither operation translates the document or guarantees understanding.

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.

All chapters in RFC 4647

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 ↗