effect-io-ai

Package: effect
Module: RegExp

RegExp.escape

Escapes special characters in a regular expression pattern.

Example

import * as assert from "node:assert"
import { RegExp } from "effect"

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

Signature

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

Source

Since v2.0.0