RegExp overview
This module provides utility functions for working with RegExp in TypeScript.
Added in v2.0.0
Table of contents
guards
isRegExp
Tests if a value is a RegExp
.
Signature
export declare const isRegExp: (input: unknown) => input is RegExp
Example
import { RegExp } from "effect"
assert.deepStrictEqual(RegExp.isRegExp(/a/), true)
assert.deepStrictEqual(RegExp.isRegExp("a"), false)
Added in v3.9.0
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