🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

is-regex

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-regex

Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag

1.2.1
latest
Source
npm
Version published
Weekly downloads
55M
-15.34%
Maintainers
0
Weekly downloads
 
Created

What is is-regex?

The is-regex npm package is a utility for checking if a value is a regular expression. It is primarily used to determine whether a given value is an instance of a RegExp object.

What are is-regex's main functionalities?

Check if a value is a RegExp

This feature allows you to verify if a value is a regular expression by returning a boolean result. It's useful when you need to ensure that a variable contains a valid RegExp object before performing operations that are specific to regular expressions.

const isRegex = require('is-regex');

console.log(isRegex(/abc/)); // true
console.log(isRegex('abc')); // false

Other packages similar to is-regex

Keywords

regex

FAQs

Package last updated on 12 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts