> For the complete documentation index, see [llms.txt](https://docs.kognitos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kognitos.com/legacy/legacy-experience/automation-areas/text/boolean-checks/check-regex-match.md).

# Check Regex Match

## Overview

This operation checks if a text conforms to a regular expression pattern. It serves as a conditional check, allowing you to perform additional operations depending on the truth of the statement.

## Syntax

This operation has two different formats. You can use either **is matched by** or **matches** to refer to the regular expression check.

#### 1. Option 1

```
the text is "{input}"
the regular expression is "{regex}"
if the text matches the regular expression then
 {action}
```

#### 2. Option 2

```
the text is "{input}"
the regular expression is "{regex}"
if the text is matched by the regular expression then
 {action}
```

## Data

The table below lists the names of the data elements in this operation and indicates which can be renamed in the syntax.

| Data Name              | Can Be Renamed |
| ---------------------- | -------------- |
| the text               | Yes            |
| the regular expression | No             |

## Parameters

**Parameters** are placeholders for data. Refer to the table below for details on each parameter in this operation. In the syntax, replace parameters with your own values.

<table><thead><tr><th width="110.765625">Parameter</th><th width="305.40234375">Description</th><th width="227.3203125">Examples</th><th>Required</th></tr></thead><tbody><tr><td><code>input</code></td><td>An input text to be checked against the regular expression.</td><td><ul><li>user123</li><li>Welcome to Kognitos.</li></ul></td><td>Yes</td></tr><tr><td><code>regex</code></td><td>A regular expression that defines the criteria the text must match.</td><td><ul><li>^[a-zA-Z0-9]+$</li><li>^\d3$</li></ul></td><td>Yes</td></tr><tr><td><code>action</code></td><td>An operation that occurs if <code>input</code> conforms to the regular expression.</td><td><ul><li>say "The username contains only letters and numbers."</li></ul></td><td>Yes</td></tr></tbody></table>

## Examples

#### 1. Validate Username Format

{% tabs %}
{% tab title="Automation" %}

<pre><code><strong>the username is "user123"
</strong>the regular expression is "^[a-zA-Z0-9]+$"
if the username matches the regular expression then
  say "The username contains only letters and numbers."
</code></pre>

{% endtab %}

{% tab title="Results" %}

```
The username contains only letters and numbers.
```

{% endtab %}
{% endtabs %}


---

# 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.kognitos.com/legacy/legacy-experience/automation-areas/text/boolean-checks/check-regex-match.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.
