---
title: RegexValidator
product: Form Library
api-type: class
description: A class that implements validation using regular expressions.
source: https://surveyjs.io/form-library/documentation/api-reference/regexvalidator
---

# `RegexValidator`

A class that implements validation using regular expressions.

[View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))

## Inheritance

[`Base`](https://surveyjs.io/form-library/documentation/api-reference/base.md) &rarr; [`SurveyValidator`](https://surveyjs.io/form-library/documentation/api-reference/surveyvalidator.md) &rarr; `RegexValidator`

## Properties

### `caseInsensitive`

**Type**: `boolean`

Specifies whether uppercase and lowercase letters must be treated as distinct or equivalent when validating values.

Default value: `false` (uppercase and lowercase letters are treated as distinct)

### `regex`

**Type**: `string`

A regular expression used to validate values.

[View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
