rfc-7405

Case-Sensitive String Support in ABNF

P. Kyzivat
date2014-12 streamIETF wgnon working group statusPROPOSED STANDARD pages4 canonicalhttps://www.rfc-editor.org/rfc/rfc7405 doi10.17487/RFC7405
This document extends the base definition of ABNF (Augmented Backus-Naur Form) to include a way to specify US-ASCII string literals that are matched in a case-sensitive manner.

updates

Extracted elements (8)

design-rationale §1

Prior ABNF (RFC 5234) only supported case-insensitive string literals; achieving case-sensitive matching required specifying individual characters by numeric value (e.g., %d97 %d98 %d99), which was inconvenient and error prone both to write and read. This document introduces explicit prefix syntax to address that gap.

process

design-rationale §2.1

Using a prefixed literal such as '%s"aBc"' for case-sensitive matching has a clear readability advantage over the prior practice of specifying each character numerically (e.g., %d97 %d98 %d99 or %x61.62.63), motivating the new syntax.

interoperability-note §2.1

Both '%i"aBc"' and the undecorated '"abc"' match the same set of strings ('abc', 'Abc', 'aBc', etc.), ensuring that existing ABNF grammars without prefixes continue to behave identically after this extension is adopted.

normative-requirement §2.1 MUST

A quoted string with no prefix is treated as case-insensitive and is equivalent to using the '%i' prefix, preserving backward compatibility with prior ABNF implementations.

protocol-element §2.2

The 'quoted-string' terminal is defined as DQUOTE followed by zero or more printable US-ASCII characters (SP and VCHAR, excluding DQUOTE itself, i.e., %x20-21 / %x23-7E), closed by DQUOTE.

protocol-element §2.1

Two type prefixes are introduced for ABNF quoted string literals: '%s' denotes case-sensitive matching and '%i' denotes case-insensitive matching. These prefixes parallel the type prefix convention already used with numeric values in ABNF.

security-consideration §3

The RFC states that security is truly believed to be irrelevant to this document, as the change is purely a syntactic extension to ABNF notation with no impact on protocol security properties.

security

wire-format §2.2

The updated 'char-val' rule is: char-val = case-insensitive-string / case-sensitive-string; case-insensitive-string = ["%i"] quoted-string; case-sensitive-string = "%s" quoted-string; quoted-string = DQUOTE *(%x20-21 / %x23-7E) DQUOTE. This replaces the char-val rule in Section 4 of RFC 5234.