# REGEXP_LIKE

> REGEXP_LIKE function in StackQL: test whether a string matches a regular expression, returning true or false, for pattern filters in WHERE clauses.

Source: https://stackql.io/language-spec/functions/re/regexp_like

Checks if source string matches pattern and returns `true` or `false`.  

See also:  
[[` SELECT `]](/language-spec/select) [[ Regular Expression Reference ]](/language-spec/functions/re/reference) 

* * * 

## Syntax

```sql
SELECT REGEXP_LIKE(source, pattern) FROM <multipartIdentifier>;
```

## Arguments

__*source*__  
A literal string or string column that you want to test for the existence of a pattern defined by a regular expression (`pattern`).  

__*pattern*__  
The regular expression pattern to search for.  

## Return Value(s)
Returns a `0` if `false` and `1` if `true`.  

* * *

## Examples

### Determine if a string contains a pattern

**StackQL**

```sql
select name, 
regexp_like(name, 'vm[0-9]+') as name_starts_with_vm 
from azure.compute.virtual_machines 
WHERE subscription_id = '273769f6-545f-45b2-8ab8-2f14ec5768dc';
```

**Results**

```
|------|---------------------|
| name | name_starts_with_vm |
|------|---------------------|
| vm0  |                   1 |
|------|---------------------|
| vm1  |                   1 |
|------|---------------------|
| test |                   0 |
|------|---------------------|
```

For more information, see [https://github.com/nalgeon/sqlean/blob/main/docs/re.md](https://github.com/nalgeon/sqlean/blob/main/docs/re.md)
