# match

Checks if the value matches the given regular expression

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/src/Toolkit/V.php#L471>

****

```php
V::match($value, string $pattern): bool
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$value` (required) | `mixed` | – | – |
| `$pattern` (required) | `string` | – | – |

## Return type

`bool`

## In your code

```php
if (V::match($value, '/[a-z0-9]+/')) {
  echo 'Yay, valid!';
}
```

## In fields

```yaml
fields:
  example:
    label: Example field
    type: text
    validate:
      match: "/[a-z0-9]+/"
```