# Match

\<evalcmd> Match && bool && **True** if *string* matches the *pattern*. && string && string && String to compare. && pattern && string && Pattern to compare against. && \[flags] && string && Optional flags are:

|       |                                                                  |
| ----- | ---------------------------------------------------------------- |
| **c** | consider case when performing the operation                      |
| **x** | simple matching against multiple file extensions                 |
| **d** | support DOS wildcard characters only                             |
| **r** | use regular expression                                           |
| **h** | easy handling for file paths (\\\ and / are considered the same) |
| **a** | "any word" mode                                                  |
| **i** | ignore diacritics                                                |
| **f** | support filetype groups                                          |
| **p** | partial matching                                                 |

\</evalcmd>

Returns **True** if the input *string* matches the specified wildcard *pattern*. By default this uses [standard pattern matching](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/wildcard_reference/pattern_matching_syntax) - specify the **r** flag to use [regular expressions](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/wildcard_reference/regular_expression_syntax) instead.

//[Example://](example://)

```
if (Match(name, "*.txt")) { ... } // does file have a .txt extension?
```


---

# 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://chaoses-ib.gitbook.io/directory-opus/manual/reference/evaluator/match.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.
