> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# REGEXP_CONTAINS

> Tests whether a regular expression matches any part of a string.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

**Aliases:** [`regexp_like`](/query/sql/functions/regex/regexp_like)

Returns NULL if value or pattern is NULL.

## Syntax

### Regexp contains form (scalar)

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
regexp_contains(value,pattern)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | STRING | Yes | The string to search. |
| pattern | STRING | Yes | The regular expression. |

## Returns

* Type: BOOLEAN
* Possible values: TRUE when a match is found, otherwise FALSE.
* NULL behavior: Returns NULL if value or pattern is NULL.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Usage notes

* Use anchors in the pattern when the whole input must match. The shared engine supports lookaround and backreferences.
* Write `value RLIKE pattern` to test for a match, or `value NOT RLIKE pattern` to test for no match.
* Character classes `\w`, `\d`, and `\s` match ASCII characters.

## Examples

### Alias calling form: REGEXP\_CONTAINS

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT regexp_contains('abc123', '[0-9]+') AS matched, regexp_contains('abc', '[0-9]+') AS unmatched;
```

| matched | unmatched |
| - | - |
| true | false |

### Require a whole-string match

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT regexp_contains('123', '^[0-9]+$') AS only_digits, regexp_contains('a123', '^[0-9]+$') AS mixed_text;
```

| only\_digits | mixed\_text |
| - | - |
| true | false |

## Limitations

* Invalid patterns or unsupported engine features raise an execution error.
* This form takes two STRING arguments. To set supported regular-expression options, include flags in the pattern. Separate flags and start-position arguments are not available in this form.
* REGEXP\_LIKE and REGEXP\_CONTAINS take two arguments; RLIKE takes two operands. None of these forms accepts a separate flags argument. For example, use the pattern '(?i)^a' for a case-insensitive match at the start of the text.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.