--- title: "Regular expression" slug: "frebehav-reg-exp" updated: 2026-05-04T12:11:00Z published: 2026-05-04T12:11:00Z canonical: "docs.lobstersoftware.com/frebehav-reg-exp" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Regular expression *See also:* [Regular expression (Validator)](/v1/docs/en/frevalidators-validate-reg-exp) > [!NOTE] > The **Behavior type** [Regular expression](/v1/docs/en/frebehav-reg-exp) checks the value of the *element to be evaluated* against the expression stored in the **Regular expression** parameter. ![images/download/attachments/189432237/image-2024-10-1_15-11-44-version-1-modificationdate-1727788305012-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-1_15-11-44-version-1-modificationdate-1727788305012-api-v2.png) - If no element is linked, the *executing element* is evaluated. - If an element is linked, then this *linked element* is evaluated. The check result determines which actions are executed: - If the return value of the *element to be evaluated* matches the **Regular expression**, the **Actions on "true"** are executed. - If the check fails, the **Actions on "false"** are executed. **NOTE:** In both cases, any behavior data is passed as `$input` to the actions and not the checked value of the *evaluated element*. By clicking on the play symbol (►) to the right of the regular expression input field, a test window can be displayed. In the test window, a possibly extensive **Test text** can be entered or inserted. The **Test text** is permanently checked against the **Regular expression** entered above, which can also be edited. - The part of the text to which the current expression applies is highlighted with green shading. - Only if the entire test text entered matches the expression entered will the ![](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-A0KPEVNT.png) symbol appear in the text input field on the right (top right image). | **Check is case sensitive** (Standard; the "/" characters may be omitted here) | **Check is not case-sensitive** (with *Flag* `i` for "ignore"; here the "/" characters are necessary) | | --- | --- | | ![images/download/attachments/189432237/image-2024-10-1_15-17-51-version-1-modificationdate-1727788671309-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-1_15-17-51-version-1-modificationdate-1727788671309-api-v2.png) | ![images/download/attachments/189432237/image-2024-10-1_15-18-41-version-1-modificationdate-1727788721111-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-1_15-18-41-version-1-modificationdate-1727788721111-api-v2.png) | > [!WARNING] > **IMPORTANT:** > > The **Behavior type** [Regular expression](/v1/docs/en/frebehav-reg-exp) executes the **Actions on "true"** in both cases, if the *element to be evaluated* returns a text value as in the example (`abcXYZ`). It is important that in both cases all the criteria of the regular expression are met, not whether the *entire* text corresponds to the expression. To ensure that the check is only passed if a string contains just lower case letters, the following expression would have to be used: ![images/download/attachments/189432237/image-2024-10-1_15-23-46-version-1-modificationdate-1727789026377-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-1_15-23-46-version-1-modificationdate-1727789026377-api-v2.png) ## Example A [Text field](/v1/docs/en/custom-custom-text-field) in a [Repeatable element](/v1/docs/en/fre-duplicate-element-container-vo) should be checked with [Changed](/v1/docs/en/fretrigger-changed) to see if the string it contains matches a regular expression that is used in the example to determine the plausibility of the input as an **Aircraft type** according to the US armed forces classification. A one or two-digit combination of certain capital letters followed by a minus sign and a maximum three-digit type number (>0) is considered plausible. Next to the input field, each line should optionally contain one of two [Button](/v1/docs/en/fre-button-vo) elements with an icon representing the check result: - If the input is plausible, a [Button](/v1/docs/en/fre-button-vo) with a check symbol should appear. - If the input is doubtful, a [Button](/v1/docs/en/fre-button-vo) with a question mark symbol should appear. Runtime example: ![images/download/attachments/189432237/image2020-5-27_21-18-21-version-1-modificationdate-1727787085295-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-5-27_21-18-21-version-1-modificationdate-1727787085295-api-v2.png) Configuration: | ![images/download/attachments/189432237/image2020-5-27_21-20-0-version-1-modificationdate-1727787085299-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-5-27_21-20-0-version-1-modificationdate-1727787085299-api-v2.png) | The [Text field](/v1/docs/en/custom-custom-text-field) in the [Repeatable element](/v1/docs/en/fre-duplicate-element-container-vo) container is configured for the behavior shown on the left: - The behavior reacts to the **Triggering event** [Changed](/v1/docs/en/fretrigger-changed), which should only become active here with the **Change type** "Exclusively by user", i.e. for interactive changes. --- - The **Behavior type** [Regular expression](/v1/docs/en/frebehav-reg-exp) defines the expression against which the value of the *executing element* should be checked. A linked element is therefore not necessary. --- - Under the **Actions on "true"**, the [Button](/v1/docs/en/fre-button-vo) with the check symbol for [Show element](/v1/docs/en/freaction-show) is set to visible and the one with the question mark symbol for [Hide element](/v1/docs/en/freaction-hide) is set to invisible. --- - The **Actions on "false"** act inversely with the same two buttons, so that after executing the behavior the desired button is always visible and the other one is invisible. | | --- | --- |