> ## Documentation Index
> Fetch the complete documentation index at: https://flexforms.bjanczak.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Write for Filament/Laravel developers buying Flex Forms.
> Be precise: every setting documents what it does and how it works.
> Use Help Center components richly: Steps, Cards, Callouts, Tabs, CodeGroup, Mermaid, Badge for Pro.
> Never invent APIs; match the real Flex Forms package behavior.

# Matches regex

> When clause operator: The text answer matches a regular expression pattern.

**Matches regex** checks whether a text answer matches your pattern (PCRE).

Use it for structured codes, custom ID formats, and advanced text gates that simple Starts with / Contains cannot express.

***

## Exact behavior

* **Text fields only.**
* Pattern max length **200**; subject is capped at **10 000** characters.
* Invalid patterns never match (fail-closed).
* Blank answers never match.
* Patterns may be written with or without delimiters (`^[A-Z]{3}$` or `/^[A-Z]{3}$/`).

***

## Related

* Opposite: [Does not match regex](/features/studio/logic/operators/not_matches_regex)
* Simpler text: [Contains](/features/studio/logic/operators/contains) · [Starts with](/features/studio/logic/operators/starts_with)

  [All operators](/features/studio/logic/operators/overview) · [How logic works](/features/studio/logic/overview)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.