Check if a value is a regular expression
$ npm install is-regexp
import isRegexp from 'is-regexp';
isRegexp('unicorn');
//=> false
isRegexp(/unicorn/);
//=> true
isRegexp(new RegExp('unicorn'));
//=> true
- 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.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.