# REGEX\_EXTRACT

| **Description** | The **`REGEX_EXTRACT()`** function is used to extract specific text from a given text string that matches a regular expression pattern. It's a powerful tool for text parsing and data extraction based on complex patterns. |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Syntax**      | REGEX\_EXTRACT(**`text`**, "**`pattern`**", \[**offset**])                                                                                                                                                                   |

1. **`text`**: The input text string from which you want to extract text.
2. **`pattern`**: The regular expression pattern used to identify the text to be extracted.
3. **offset**: (Optional) An offset (number greater than 0) that specifies which match to extract when there are multiple matches in the text.

## Example

### Table

| ID | Original Text                                    |
| -- | ------------------------------------------------ |
| 1  | Product ID: ABC123, Price: $45.99                |
| 2  | Order: ORD98765, Date: 2023-09-15                |
| 3  | Phone: (555) 555-5555, Email: <john@example.com> |

### Function

```
REGEX_EXTRACT(Original Text, "[A-Z]+\\d+", 1)
```

### Results

| REGEX\_EXTRACT (text) |
| --------------------- |
| ABC123                |
| ORD98765              |
| *(null)*              |
