> For the complete documentation index, see [llms.txt](https://docs.wproofreader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wproofreader.com/v6.11.1/api-reference/style-guide-api/validation-and-limits.md).

# Validation & limits

These constraints apply to `patterns`, `suggestions`, `context_include`, `context_exclude`, and `description`.

### Forbidden characters

Forbidden characters are validated per-field.

| Field(s)                                                        | Forbidden characters                                                                       | Notes                                            |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------ |
| `patterns`, `suggestions`, `context_include`, `context_exclude` | `#` `;` `[` `]` `<` `>` `{` `}` and control characters: `\n` `\t` `\b` `\r` `\a` `\f` `\v` | Control characters are rejected even if escaped. |
| `description`                                                   | `#` `[` `]` `<` `>` `{` `}` and control characters: `\n` `\t` `\b` `\r` `\a` `\f` `\v`     | Same as above, but `;` is allowed.               |

### Length limits

Limits are Unicode character count.

The limit is the **total length across all values** when the field is an array.

| Field             | Max length (Unicode chars) | Notes                                                |
| ----------------- | -------------------------- | ---------------------------------------------------- |
| `patterns`        | 150                        | If this is an array, sum of all items must be ≤ 150. |
| `suggestions`     | 150                        | If this is an array, sum of all items must be ≤ 150. |
| `context_include` | 150                        | If this is an array, sum of all items must be ≤ 150. |
| `context_exclude` | 150                        | If this is an array, sum of all items must be ≤ 150. |
| `description`     | 200                        | Always checked as a single string.                   |

### Uniqueness and cross-field rules

| Constraint                                | What it means                                                                                            |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Unique `patterns`                         | All `patterns` values must be unique within a rule.                                                      |
| Unique `suggestions`                      | All `suggestions` values must be unique within a rule.                                                   |
| Pattern vs suggestion collision           | A `patterns` value cannot equal any `suggestions` value.                                                 |
| Context vs pattern collision (`include`)  | No `context_include` item may equal any `patterns` item.                                                 |
| Context vs pattern collision (`exclude`)  | No `context_exclude` item may equal any `patterns` item.                                                 |
| Include vs exclude collision              | No `context_exclude` item may equal any `context_include` item.                                          |
| No substring overlap in `context_include` | No `context_include` value may be a substring of another `context_include` value.                        |
| No substring overlap in `context_exclude` | No `context_exclude` value may be a substring of another `context_exclude` value.                        |
| Rule-level duplication in a file          | Two rules with the same `patterns` + `context_include` combination are not allowed within the same file. |

### Limits

| Limit                      | Value     |
| -------------------------- | --------- |
| Maximum rules per language | **2,000** |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wproofreader.com/v6.11.1/api-reference/style-guide-api/validation-and-limits.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
