Hyperlinkv0.8.0-beta.28

RegExp

RegExp.isRegExpconsteffect/RegExp.ts:61
(input: unknown): input is RegExp

Checks whether a value is a RegExp.

When to use

Use to validate unknown input before treating it as a regular expression.

Example (Checking for regular expressions)

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

assert.deepStrictEqual(RegExp.isRegExp(/a/), true)
assert.deepStrictEqual(RegExp.isRegExp("a"), false)
guards
Source effect/RegExp.ts:611 lines
export const isRegExp: (input: unknown) => input is RegExp = predicate.isRegExp