Skip to main content

isRegEx

Validates if the supplied input is a regular expression (RegExp instance).

Signature​

isRegEx(input: any): boolean

Parameters​

NameTypeOptionalDescription
inputanyNoInput to validate.

Return value​

Returns true if the input is a regular expression.

Example​

import { isRegEx } from "@tripetto/runner";

isRegEx(/[a-z]+/); // Returns `true`