# matches

Source: https://taxilang.org/docs/language/stdlib/matches

**Full name:** `taxi.stdlib.matches`

## Signature

```taxi
declare extension function matches(source: String, regex: String): Boolean
```

## Description

Returns `true` if the **entire** source string matches the provided regular expression.

Uses full-string matching — the pattern must match the entire string, not just a part of it.
Use `containsPattern` for partial (substring) matching.

```taxi
find { account: Account } as {
   isValidCode: Boolean = account.code.matches('^[A-Z]{3}-\d{4}$')
}
```

## Examples

Returns `true` only when the full string matches the regex pattern.

Query:

```taxi
find {
   fullMatch: Boolean = 'hello'.matches('^h.*o$')
   noFullMatch: Boolean = 'hello'.matches('^he')
}
```

Result:

```json
{
  "fullMatch": true,
  "noFullMatch": false
}
```
