---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.5
alternate:
  - https://divkit.tech/docs/en/concepts/divs/2/div-input-validator-regex.md
  - https://divkit.tech/docs/ru/concepts/divs/2/div-input-validator-regex.md
  - href: en/concepts/divs/2/div-input-validator-regex.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://divkit.tech/docs/en/llms.txt

# div-input-validator-regex
Regex validator.

## Parameters
| Parameters | Description |
| --- | --- |
| `label_id` | <p>**string**</p><p>Required parameter.</p><p>ID of the text element containing the error message. The message will also be used for providing access.</p><p>Available platforms: Android, iOS, web.</p> |
| `pattern` | <p>**string**</p><p>Required parameter.</p><p>A regular expression (pattern) that the field value must match.</p><p>Available platforms: Android, iOS, web.</p> |
| `type` | <p>**string**</p><p>Required parameter.</p><p>The value must always be `regex`.</p><p>Available platforms: Android, iOS, web.</p> |
| `variable` | <p>**string**</p><p>Required parameter.</p><p>The name of the variable that stores the calculation results.</p><p>Available platforms: Android, iOS, web.</p> |
| `allow_empty` | <p>**bool_int**</p><p>Determines whether the empty field value is valid.</p><p>Default value: `false`.</p><p>Available platforms: Android, iOS, web.</p> |

<details>
<summary>JSON</summary>

```json
{
  type*: "regex",
  allow_empty: "bool_int",
  label_id*: "string",
  pattern*: "string",
  variable*: "string"
}
```
</details>
