﻿---
title: ES|QL MV_RLIKE function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/3716/reference/query-languages/esql/functions-operators/mv-functions/mv_rlike
products:
  - Elasticsearch
---

# ES|QL MV_RLIKE function
<applies-to>
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Planned
</applies-to>

Checks if any value of a multivalue field matches a regular expression.

## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/3716/reference/query-languages/esql/images/generated/x-pack-esql/functions/mv_rlike.svg)


## Parameters

<definitions>
  <definition term="field">
    Multivalue expression to test. If null or empty, the function returns `false`.
  </definition>
  <definition term="pattern">
    Regular expression. Must be a constant. The pattern must match a value in full, as with `RLIKE`.
  </definition>
</definitions>


## Description

Returns `true` when any value yielded by `field` matches `pattern`, using the same regular-expression syntax as `RLIKE`. The pattern must match a value in full, as with `RLIKE`. `RLIKE` is a single-value scalar: applied to a multivalue field it emits a warning and returns `null`, so this is how you match a regular expression against a multivalue field. A null or empty `field` returns `false`, and because the result is never null the predicate composes under `AND`/`OR`/`NOT`.

## Supported types


| field   | pattern | result  |
|---------|---------|---------|
| keyword | keyword | boolean |
| keyword | text    | boolean |
| text    | keyword | boolean |
| text    | text    | boolean |


## Examples

```esql
ROW names = ["Anna", "Bob", "Carl"]
| EVAL any_starts_with_a = mv_rlike(names, "A.*")
```


| names:keyword     | any_starts_with_a:boolean |
|-------------------|---------------------------|
| [Anna, Bob, Carl] | true                      |

Character classes work as they do in `RLIKE`:
```esql
ROW names = ["Anna", "Bob"]
| EVAL has_three_letter_b_name = mv_rlike(names, "[Bb]ob")
```


| names:keyword | has_three_letter_b_name:boolean |
|---------------|---------------------------------|
| [Anna, Bob]   | true                            |