# REGEXP_SUBSTR() Function

### Description

Returns a substring that matches a regular expression pattern

### Syntax

```sql
REGEXP_SUBSTR(source_string, pattern [, position [, occurrence [, match_type [, subexpression ]]]])
```

### Parameters

| Parameter | Description | Data Type | Required |
| --- | --- | --- | --- |
| _string_ | String value | String | Yes |
| _pattern_ | The pattern argument | String | Yes |

### Example

```sql
SELECT
    REGEXP_SUBSTR(email, '@(.+)$')
FROM
    rippling.employee.Employee
LIMIT
    5;
```

Source: https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/regexp_substr

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
