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

Scan extended subtags

03

Extended filtering can skip an intervening script subtag while preserving the requested order. An interior * does not consume exactly one piece, and an unmatched singleton stops the scan.

RFC 4647 · § 3.3.2EXAMPLE
4 / 4
04
Stop at an unmatched singleton

Now compare a separate candidate, de-x-DE. While seeking DE, x is an unmatched singleton. Stop there; the later DE is not reached.

Scan extended subtagsNow compare a separate candidate, de-x-DE. While seeking DE, x is an unmatched singleton. Stop there; the later DE is not reached.Extended range: de-*-DESeparate candidate: de-x-DEdexDEscanDE not reachedUnmatched x stops the scanNo match for this candidate

Key idea: Skip a nonmatching long subtag, but never skip an unmatched one-character singleton.

Terms
Extended filtering
Find required subtags in order, with the RFC’s wildcard and singleton rules.
Singleton
A one-letter or one-digit subtag, including x.
Private use
A meaning agreed between participants, rather than standardized in the registry.

Look up a term in the glossary ↗

Rules & examples
  • Split range and tag at hyphens. Compare their first subtags; an initial * matches the first tag subtag. Ignore later wildcard subtags in the range.
  • Then seek each required subtag in order. Equal subtags advance both lists. A nonmatching tag subtag can be skipped only if it is not a singleton.
  • de-*-DE matches both de-DE and de-Latn-DE. Under extended filtering, de-DE without the interior * has the same result. Wildcards do not imply a fixed gap size.
  • For de-x-DE, the unmatched x stops a scan for DE. A singleton that actually equals the required range subtag is compared normally; it is not an unconditional barrier.
  • A missing required subtag also fails. Private-use values need prior agreement; their meanings are not standardized by matching (§4.3).

Verified erratum8838 corrects the link to this algorithm. This is ordered string/subtag matching, not a claim of semantic compatibility or a rule for interpreting private-use values.

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 ↗