Files
lcbp3.np-dms.work/frontend/node_modules/is-regexp/readme.md
2025-09-21 20:29:15 +07:00

45 lines
936 B
Markdown

# is-regexp
> Check if a value is a regular expression
## Install
```
$ npm install is-regexp
```
## Usage
```js
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?](https://github.com/sindresorhus/is#why-not-just-use-instanceof-instead-of-this-package)
## Related
- [is](https://github.com/sindresorhus/is) - Type check values
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-is-regexp?utm_source=npm-is-regexp&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>