# Regex literal

Learn how to represent regular expressions for pattern matching.

Regular expression, or [Regex](https://en.wikipedia.org/wiki/Regex) for short, provides a powerful and flexible way to match patterns in strings.

> **What regex variant does CQL support?**
>
> CQL supports the [PCRE](https://www.pcre.org/) variant, which is widely used and known for its rich feature set and strong performance.

A regular expression literal is expressed using the `~/` delimiter, followed by the pattern, a slash `/`, and optionally one or more [modifiers](/reference/cql/expressions/modifiers).

Here is a basic example with all the parts:

```cql
~/[a-z]/i
```

In this example, the regular expression `[a-z]` matches any lowercase letter from `a` to `z`. The `i` modifier indicates that the match should be case-insensitive, allowing it to also match uppercase letters from `A` to `Z`.

## Explore

- [Matches test](/reference/cql/expressions/tests/string/matches): Learn how to check if a string matches a regular expression.
- [Regex tutorial](https://www.regular-expressions.info/tutorial.html): Check out a detailed tutorial on regular expressions.
