---
title: "match — Regular expression match"
description: "iXML command match: Regular expression match."
canonical_url: "https://www.zeyos.com/ixml/ref/match"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/match.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# match — Regular expression match

MATCH performs a global regular expression match on a subject against a given pattern and assignes the number of full matches to 'var', while the actual matches are assigned to 'var_matches'.

Results are ordered so that matches[0] is an array of first set of matches, matches[1] is an array of second set of matches, and so on.

If the offset is negative it will start that many characters from the end of the subject.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Result variable name for number of matches |
| var_matches | var |  | Result variable name for actual matches |
| pattern | regexp |  | Pattern |
| offset | int |  | Search offset |

### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- binding: var; type: int
- binding: var_matches; type: array; predicate: no-result-propagation

### Examples

```xml
<match var="count" var_matches="matches" pattern="/ixml/i">My name is iXML!</match>

<if value1="$count" func="&gt;" value2="0">
	<output>$matches[0][0]</output>
</if>

<!-- iXML -->
```
