aboutsummaryrefslogtreecommitdiff
path: root/node_modules/is-regexp/readme.md
blob: ccdbed5dea3b2f7238bb72c94805da7389da04ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# is-regexp [![Build Status](https://travis-ci.org/sindresorhus/is-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/is-regexp)

> Check whether a variable is a regular expression


## Install

```sh
$ npm install --save is-regexp
```


## Usage

```js
var isRegexp = require('is-regexp');

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

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

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


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)