Describing the required shape
Programs often need to identify a kind of input and extract its components. A pattern can express both tasks together, such as requiring a pair and naming its two elements. A successful branch then works with those components instead of repeating separate tests and extraction operations throughout the program.
Constants, bindings, and nested structures
Patterns can require a literal value, bind a name to matched data, or ignore a component through a wildcard. Nested patterns can decompose tuples, records, and enum values. Whether a name compares an existing value or creates a new binding is language-specific, so its role cannot be inferred from spelling alone.
Branch order and guards
Several patterns may accept the same input, making branch order significant. A guard adds a condition after structural matching, such as requiring an extracted number to exceed a threshold. An overly general early pattern can hide later cases, and successfully binding a value does not establish every application-level validity condition.
Different families of matching
SNOBOL developed matching around strings, while modern languages also match structured data. These systems share a concern with recognizable forms but can differ in binding, backtracking, and supported structures. Rust uses patterns in bindings and other contexts as well as branches, so both the data and the surrounding construct matter.