# RegEx - Input Validation

The **RegEx** metadata type can be used to validate and enforce that users enter a value in a specific format.

For example, if a *production ID* must follow a strict rule — **one uppercase letter followed by five digits** — this metadata type can ensure that only valid IDs are accepted.

The corresponding regular expression is:

```
^[A-Z]\d{5}$
```

This expression enforces the following:

* `^` — start of the string
* `[A-Z]` — exactly one uppercase letter
* `\d{5}` — exactly five digits (0–9)
* `$` — end of the string

As a result, valid values would include `A12345` or `Z00001`, while entries such as `AA12345`, `a12345`, or `A1234` would be rejected.

To configure this, a regular expression (regex) pattern must be defined.\
If you need help creating a suitable expression, you can use online generators or tools such as:\
<https://www.leiga.com/free-tools/regex-expression-generator>

Enter the regex pattern in the **Default Value** field.

The **Value** field should remain empty. The displayed warning can be ignored.

<figure><img src="/files/mW2AxYy7TZjSi6Vs6alF" alt=""><figcaption><p>Regex metadata</p></figcaption></figure>

#### Limitation

If a RegEx metadata type is assigned to either a **group** or a **metadata set**, the field *must always be filled with a valid value*.\
This metadata type effectively behaves as a mandatory field, because the input validation prevents saving empty or invalid values. Disabling this requirement is not possible.


---

# Agent Instructions: 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:

```
GET https://docs.helmut.de/helmut4-releases/helmut4-components/helmutfx/metadata/regex-input-validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
