---
title: "regexp_escape function in Strata | Oplema"
description: "Escape special characters in text so that a regular expression matches it literally. Write it as regexp_escape(string) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/regexp-escape"
updated: "2026-11-04"
---

# regexp\_escape

Escape special characters in text so that a regular expression matches it literally.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **VARCHAR**.

### Expression

```
regexp_escape('https://duckdb.org')
```

### Result

```
'https\:\/\/duckdb\.org'
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | https\\:\\/\\/duckdb\\.org |

## Arguments and types

```
regexp_escape(string)
```

**string**

Text

Supported signatures (1)

```
regexp_escape(string: VARCHAR) → VARCHAR
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[parse\_filename

Return the last component of a path, such as c.txt for a/b/c.txt. Set trim\_extension to true to remove the file extension. The optional separator can be system, both\_slash (default), forward\_slash or backslash.

](https://oplema.com/docs/strata/functions/parse-filename)[parse\_path

Return the directories and filename in a path as a list. The optional separator can be system, both\_slash (default), forward\_slash or backslash.

](https://oplema.com/docs/strata/functions/parse-path)[ilike\_escape

Check whether text matches a LIKE pattern, ignoring uppercase and lowercase. The escape character lets the pattern search for a literal % or \_.

](https://oplema.com/docs/strata/functions/ilike-escape)[like\_escape

Check whether text matches a LIKE pattern, treating uppercase and lowercase as different. The escape character lets the pattern search for a literal % or \_.

](https://oplema.com/docs/strata/functions/like-escape)

[Browse patterns](https://oplema.com/docs/strata/functions#patterns) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/text.html#regexp_escapestring)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
