RegExp.ts overview

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

Since v2.0.0


Exports Grouped by Category


guards

isRegExp

Tests if a value is a RegExp.

Example

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

assert.deepStrictEqual(RegExp.isRegExp(/a/), true)
assert.deepStrictEqual(RegExp.isRegExp("a"), false)

Signature

declare const isRegExp: (input: unknown) => input is RegExp

Source

Since v3.9.0

utils

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