patternvariable

noun
UK /ˈpætən ˈveəriəbl/
US /ˈpætərn ˈveriəbəl/

A pattern variable is a special name in a pattern that holds a piece of information you just found.

In the pattern 'name is Ana', the word 'name' is a pattern variable that stores 'Ana'.


OTHER MEANINGS

2. In functional programming, a name that captures part of a matched value for later use.

The pattern (x, y) uses x and y as pattern variables for the two parts of the pair.

3. In logic and rewriting, a symbol that stands for any term matching a rule.

The rule f(x) → x uses x as a pattern variable that can match any argument.

4. In text search, a token that stands for a changing part of a string.

The search pattern 'file_*.txt' uses a pattern variable to match any file name.