// package
is-regexp
type: "module"
// preferences
// replacements (1)
snippet::is-regexp
Simple or drop-in replacementThis package is no longer necessary. You can use `instanceof RegExp` to check if a value is a regular expression, or if cross-realm, use `Object.prototype.toString.call(v) === "[object RegExp]"`.
// example
const isRegExp = (v) => v instanceof RegExp;
// for cross-realm
const isRegExpCrossRealm =
Object.prototype.toString.call(v) ===
'[object RegExp]';