is-regexp
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

is-regexp

Check if a value is a regular expression

Install

$ npm install is-regexp

Usage

import isRegexp from 'is-regexp';

isRegexp('unicorn');
//=> false

isRegexp(/unicorn/);
//=> true

isRegexp(new RegExp('unicorn'));
//=> true

FAQ

Why not just use instanceof instead of this package?

Related

  • is - Type check values

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.1.0
    119,193
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.1.0
    119,193
  • 3.0.0
    147
  • 2.1.0
    1,389,375
  • 2.0.0
    139
  • 1.0.0
    7,587,775

Package Sidebar

Install

npm i is-regexp

Weekly Downloads

9,096,629

Version

3.1.0

License

MIT

Unpacked Size

3.18 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus