# Data Loss Prevention V2 Client - Class Regex (2.13.0)

2.13.0 (latest) 2.12.0 2.11.0 2.10.0 2.9.2 2.8.1 2.7.0 2.6.1 2.4.1 2.3.0 2.2.3 2.1.0 2.0.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.1 1.14.0 1.13.2 1.12.0 1.11.0 1.10.2 1.9.0 1.8.6 Reference documentation and code samples for the Data Loss Prevention V2 Client class Regex.

Message defining a custom regular expression.

Generated from protobuf message `google.privacy.dlp.v2.CustomInfoType.Regex`

## Namespace

Google \\ Cloud \\ Dlp \\ V2 \\ CustomInfoType

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ pattern` | `string` Pattern defining the regular expression. Its syntax (<https://github.com/google/re2/wiki/Syntax>) can be found under the google/re2 repository on GitHub. |
| `↳ group_indexes` | `int[]` The index of the submatch to extract as findings. When not specified, the entire match is returned. No more than 3 may be included. |

### getPattern

Pattern defining the regular expression. Its syntax
(<https://github.com/google/re2/wiki/Syntax>) can be found under the
google/re2 repository on GitHub.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setPattern

Pattern defining the regular expression. Its syntax
(<https://github.com/google/re2/wiki/Syntax>) can be found under the
google/re2 repository on GitHub.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGroupIndexes

The index of the submatch to extract as findings. When not
specified, the entire match is returned. No more than 3 may be included.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setGroupIndexes

The index of the submatch to extract as findings. When not
specified, the entire match is returned. No more than 3 may be included.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |