Skip to main content Link Search Menu Expand Document (external link)

RegExp overview

This module provides utility functions for working with RegExp in TypeScript.

Added in v2.0.0


Table of contents


utils

escape

Escapes special characters in a regular expression pattern.

Signature

export declare const escape: (string: string) => string

Example

import { RegExp } from "effect"

assert.deepStrictEqual(RegExp.escape("a*b"), "a\\*b")

Added in v2.0.0