---
name: "regexMatch"
type: command
status: ok
groups: ["Strings - Regular Expression"]
arma3_since: "2.06"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/regexMatch
revid: 369126
updated: 2024-09-03T10:34:33Z
---

# regexMatch

*Command · Strings - Regular Expression · Arma 3 v2.06*

## Description

Returns whether the *haystack* matches the *pattern*.

## Syntax

```sqf
haystack regexMatch pattern
```

**Parameters:**

- `haystack`: [String](../topics/String.md)
- `pattern`: [String](../topics/String.md) - in format regex pattern

**Returns:** [Boolean](../topics/Boolean.md) - returns [true](../commands/true.md) if match was found, otherwise [false](../commands/false.md)

## Examples

### Example 1

```sqf
"I'm a coOkIe clicker" regexMatch ".*cookie.*"; // true
```

### Example 2

```sqf
"I'm a coOkIe clicker" regexMatch ".*cookie.*/"; // false, empty flags == case sensitive
```

### Example 3

```sqf
forceUnicode 1;
"I'm a coÖkIe clicker" regexMatch ".*coökie.*";
```

### Example 4

```sqf
"Cookie clicker" regexMatch "cookie/i"; // false, pattern does not fully match the haystack
```

## See also

[regexFind](../commands/regexFind.md) · [regexReplace](../commands/regexReplace.md)

<sub>Source: [BI Community Wiki — regexMatch](https://community.bistudio.com/wiki/regexMatch) (revision 369126).</sub>
