> For the complete documentation index, see [llms.txt](https://docs.decube.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decube.io/data-quality-v2/monitor-types/field-health/string-checks.md).

# String Checks

String Length, Regex Match, Regex Not Match tests.

These three monitors apply only to string-type columns (char, varchar, text, and similar).

### String Length <a href="#string-length" id="string-length"></a>

#### What it does <a href="#what-it-does" id="what-it-does"></a>

Checks that the length of the text in a column falls within an expected range.

#### When to use it <a href="#when-to-use-it" id="when-to-use-it"></a>

A business requires usernames in a `users` table to be between 3 and 20 characters. A daily check flags any username shorter or longer than that range as a failing row.

#### What's configurable <a href="#whats-configurable" id="whats-configurable"></a>

* **Schedule** — fixed recurring, or Manual (requires Full Table Scan if Manual).
* **Scan Method** — Full Table Scan or Incremental Scan.
* **Threshold** — an Integer Range: a minimum and/or maximum character length. Defines what counts as a failing row. At least one bound is required.
* **Tolerance** (optional) — how many, or what percentage of, failing rows are allowed.

#### Worked example <a href="#worked-example" id="worked-example"></a>

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2FzvklCtVbvWC9VJaUCqy7%2Fimage-20260812-021521.png?alt=media&amp;token=237d4134-f391-4d84-ab0f-d4a95f8a8c90" alt=""><figcaption></figcaption></figure>

* Asset: `users` table, column `username`
* Threshold: Integer Range — min 3, max 20
* Tolerance: not set

**Resulting rules:**

* "A row fails when the length of the value in username is below 3 or above 20."
* "An incident will be created when any row fails."

### Regex Match / Regex Not Match <a href="#regex-match-regex-not-match" id="regex-match-regex-not-match"></a>

#### What it does <a href="#what-it-does.1" id="what-it-does.1"></a>

Two variants of the same idea: check whether the text in a column matches, or does not match, a regular expression pattern.

* **Regex Match** — a row fails if its value does not match the pattern. Use this to enforce a required format.
* **Regex Not Match** — a row fails if its value does match the pattern. Use this to forbid a format or pattern.

#### When to use it <a href="#when-to-use-it.1" id="when-to-use-it.1"></a>

* **Regex Match** — A business expects an `email` column to only contain valid emails (a pattern like `user@example.com`). A Regex Match check using an email-format pattern flags any value that doesn't match.
* **Regex Not Match** — A business expects a `name` column to never contain a salutation (Mr, Mrs, Ms, Dr, Prof). A Regex Not Match check using a salutation pattern flags any value that matches — that is, contains a salutation.

#### What's configurable <a href="#whats-configurable.1" id="whats-configurable.1"></a>

* **Schedule** — fixed recurring, or Manual (requires Full Table Scan if Manual).
* **Scan Method** — Full Table Scan or Incremental Scan.
* **Pattern** — the regular expression itself. There's no separate Threshold field for these checks — the pattern alone determines whether a row passes or fails.
* **Tolerance** (optional) — how many, or what percentage of, failing rows are allowed.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fbuy4sUbXD7R5x73bfxvz%2Fimage-20260812-020246.png?alt=media&amp;token=78ce0a08-3b04-441e-87fe-9bf60e0e64de" alt=""><figcaption></figcaption></figure>

#### Worked example — Regex Match <a href="#worked-example-regex-match" id="worked-example-regex-match"></a>

* Asset: `users` table, column `email`
* Pattern: `^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$`
* Tolerance: not set

**Resulting rule:** "An incident will be created when any row fails." (A row fails here when its value does not match the pattern.)

#### Worked example — Regex Not Match <a href="#worked-example-regex-not-match" id="worked-example-regex-not-match"></a>

* Asset: `users` table, column `name`
* Pattern: `(?i)\b(mr|mrs|ms|dr|prof)\.?\b`
* Tolerance: Percentage — 2%

**Resulting rule:** "An incident will be created when more than 2.0% of the scanned rows fail." (A row fails here when its value matches the pattern — that is, it contains a salutation.)

### Notes <a href="#notes" id="notes"></a>

* Changing the schedule or scan method later is a destructive change (it creates a new monitor version).
* Unlike a threshold or tolerance tweak, changing the pattern on a Regex Match or Regex Not Match monitor is also treated as destructive, since it redefines what a passing row looks like. Adjusting only the tolerance value is not destructive.
