Skip to content

sindresorhus/is-regexp

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

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.

About

Check if a value is a regular expression

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors