> **Experimental**
>
> `@aws-cdk/aws-bedrock-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# RegexFilter

A Regular expression (regex) filter for sensitive information.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`bedrock/guardrails/guardrail-filters.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-bedrock-alpha/bedrock/guardrails/guardrail-filters.ts#L734)

## Example

```ts
const guardrail = new bedrock.Guardrail(this, 'bedrockGuardrails', {
  guardrailName: 'my-BedrockGuardrails',
});
// Add regex filter with input/output actions
guardrail.addRegexFilter({
  name: 'TestRegexFilter',
  pattern: 'test-pattern',
  action: bedrock.GuardrailAction.ANONYMIZE,
  // below props are optional
  description: 'This is a test regex filter',
  inputAction: bedrock.GuardrailAction.BLOCK,
  inputEnabled: true,
  outputAction: bedrock.GuardrailAction.ANONYMIZE,
  outputEnabled: true,
});
```

## Properties

- `action`: [GuardrailAction](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.GuardrailAction.html) (required) — The action to take when a regex match is detected.

- `description`: string — The description of the regex filter.

  **Default:** No description

- `inputAction`: [GuardrailAction](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.GuardrailAction.html) = GuardrailAction.BLOCK — The action to take when a regex match is detected in the input.

- `inputEnabled`: boolean = true — Whether the regex filter is enabled for input.

- `name`: string (required) — The name of the regex filter.

- `outputAction`: [GuardrailAction](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.GuardrailAction.html) = GuardrailAction.BLOCK — The action to take when a regex match is detected in the output.

- `outputEnabled`: boolean = true — Whether the regex filter is enabled for output.

- `pattern`: string (required) — The regular expression pattern to match.
