Socket
Socket
Sign inDemoInstall

is-regex

Package Overview
Dependencies
Maintainers
1
Versions
12
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


Version published
Weekly downloads
34M
increased by1.04%
Maintainers
1
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

FAQs

Package last updated on 06 Aug 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc