> ## Documentation Index
> Fetch the complete documentation index at: https://tradepost.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Region tag format

> The template language for region tags.

A template, not a regular expression. Write the shape using tokens and literal
text. Everything that is not a token matches literally, including spaces. Separate
alternatives with `|`.

## Tokens

| Token       | Matches                                 | Sample  | Uppercased |
| ----------- | --------------------------------------- | ------- | ---------- |
| `<COUNTRY>` | Two letters                             | `US`    | Yes        |
| `<STATE>`   | Two or three letters                    | `NY`    | Yes        |
| `<CODE>`    | Up to six letters or digits             | `12`    | Yes        |
| `<DIGITS>`  | Up to six digits                        | `90`    | No         |
| `<TEXT>`    | Up to twenty letters, digits and spaces | `Metro` | No         |

## Recipes

| Convention                                | Format                           | Accepts                   |
| ----------------------------------------- | -------------------------------- | ------------------------- |
| Country and state, or country *(default)* | `<COUNTRY>-<STATE> \| <COUNTRY>` | `US-NY`, `UK`             |
| Country only                              | `<COUNTRY>`                      | `US`, `CA`                |
| Numbered zones                            | `Zone <DIGITS>`                  | `Zone 5`                  |
| Country and postcode                      | `<COUNTRY>-<CODE>`               | `US-90210`                |
| Named area                                | `<TEXT>`                         | `Metro East`              |
| Code or name                              | `<COUNTRY>-<STATE> \| <TEXT>`    | `US-NY`, `Greater London` |

## Limits

|                        |                |
| ---------------------- | -------------- |
| Format length          | 120 characters |
| Alternatives           | 4              |
| Tokens per alternative | 6              |
| Resulting tag          | 24 characters  |

## Refused on save

* **Blank.** To drop region tags, set **Region tag** to "Not used" instead.
* **No tokens anywhere.** A literal-only format accepts exactly one region. A
  literal-only *alternative* is fine: `<COUNTRY>-<STATE> | UK` is valid.
* **An unknown token**, or an angle bracket outside a token.
* **A character literals do not allow.** Literals accept letters, digits, spaces,
  and `-` `/` `.` `,` `#`.
* **An alternative that could exceed 24 characters.**

## Notes

* **Literals are stored as you wrote them.** With `Zone <DIGITS>`, a trader typing
  `zone 5` gets `Zone 5`.
* **The format generates the help text.** The placeholder, the field example and
  the trader's error message are all built from your format using each token's
  sample. Nothing else needs updating.
* **Changing the format does not rewrite saved regions.** Saved regions are checked
  for shape only, so a trader can keep one that no longer matches and will hit a
  publish-time error. Announce a format change on a busy subreddit.
* **Spaces inside an alternative count.** `Zone <DIGITS>` accepts `Zone 5`;
  `Zone<DIGITS>` accepts `Zone5`. Spaces around `|` are trimmed.
