Visual RFC.
ALL RFCs / RFC 9309
Read the RFC ↗
RFC 9309 / ROBOTS EXCLUSION PROTOCOL

Match wildcards and percent-encoded bytes

04

Patterns can contain * for zero or more characters and $ to mark the end. Byte comparison also accounts for URI percent-encoding, so a literal special character is different from a wildcard operator.

RFC 9309 · § 2.2.3EXAMPLE
3 / 3
Match wildcards and percent-encoded bytesStatic stepped anatomy compares a slash-prefixed wildcard PDF pattern with matching and nonmatching suffixes, then shows percent2A as a literal star instead of a wildcard. The final state independently normalizes unreserved percent62 to b, preserves the reserved slash in a percent2F b, and encodes chosen Unicode é as C3 A9 UTF-8 bytes. This is a bounded worked byte comparison, not a full URI normalization implementation.Operators and literal bytes differ/%62az → /bazUnreserved b is decoded/a%2Fb stays /a%2FbReserved slash is not decodedé → C3 A9 → %C3%A9UTF-8 bytes, not one Unicode octet
03
Decode unreserved escapes and preserve reserved ones.

%62 is the unreserved ASCII b, so /%62az compares as /baz. The reserved slash in /a%2Fb stays encoded. The non-ASCII é is represented by its UTF-8 percent-encoded bytes.

Source for this drawing: RFC 9309 · Read RFC section 2.2.3 ↗

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.

Terms in this drawing
Wildcard
The * operator matching zero or more characters.
Percent-encoding
Representing a byte as % followed by two hexadecimal digits.
Related RFCs and changes

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

KEY POINT

Crawlers MUST support # comments, * for zero or more characters and $ for the end of a match pattern. Literal special characters SHOULD be percent-encoded when matched verbatim in a URI.

  • Crawlers MUST support # comments, * for zero or more characters and $ for the end of a match pattern. Literal special characters SHOULD be percent-encoded when matched verbatim in a URI.
  • The chosen Disallow: /*.pdf$ matches /files/a.pdf. Its end anchor means /files/a.pdfx does not match that rule. All patterns used here start with /, avoiding the unverified leading-* grammar discrepancy.
  • To match a literal asterisk in a filename, /file-%2A.txt uses an encoded byte rather than the * wildcard. Encoding a literal dollar similarly uses %24.
  • Before comparison, non-ASCII octets and reserved octets require the percent-encoding treatment specified in section 2.2.2. A percent-encoded ASCII unreserved octet in the URI MUST be decoded; reserved or non-unreserved bytes remain encoded.
  • Thus /%62az normalizes to /baz, while /a%2Fb does not become /a/b by decoding its reserved slash. The chosen character é is UTF-8 bytes C3 A9, represented as %C3%A9 for comparison. Do not count its Unicode code point as one octet.
DETAILS

These are worked matching examples, not a full URI-normalization implementation. A bare * means wildcard; %2A is a literal encoded byte. The figure-4 Unicode wording and leading-* ABNF discrepancy have reported errata 7128 and 7995; the guide uses independently derived UTF-8 values and slash-prefixed patterns instead of treating those reports as accepted changes. Query components require the RFC’s URI comparison treatment; a regex over decoded human-readable filenames alone is insufficient.

Read the RFC section ↗

All chapters in RFC 9309

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 ↗