is-regexp
Check if a value is a regular expression
Last updated 6 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install is-regexp 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 3.1.0                                ...           latest (3 years ago)

5 Versions

  • 3.1.0                                ...           3 years ago
  • 3.0.0                                ...           4 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           7 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |