# pattern

*noun*

say it: **“PAT-ern”** **/ˈpætərn/**

An attribute holding a rule for the shape of a text answer, written as a regular expression that the whole answer must match.

## What is **`pattern`**?

**`pattern`** — A regular expression that a supported text control's complete value must match.

## In a sentence

- “With **pattern**="\[0-9\]{5}", the ZIP code box only accepts five digits.”
- “The **pattern** matched the whole answer, so 123456 was refused as well as 1234.”

Level: Apprentice · [More HTML terms at this level](https://www.ask-codey.com/glossary?category=html&level=2)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/pattern
