# to-regexp

> Convert globs, strings, and arrays to a single RegExp.

Latest version **0.1.7** (published 2016-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-regexp
pnpm add to-regexp
yarn add to-regexp
bun add to-regexp
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2016-02-02 |
| First published | 2015-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | zeekay |
| Keywords | regex |

## Links

- npm: https://www.npmjs.com/package/to-regexp
- Repository: https://github.com/zeekay/to-regexp
- Homepage: https://github.com/zeekay/to-regexp#readme
- Issues: https://github.com/zeekay/to-regexp/issues
- npm.io page: https://npm.io/package/to-regexp

## Dependencies (5)

- [is-array](https://npm.io/package/is-array.md) ^1.0.1
- [is-regexp](https://npm.io/package/is-regexp.md) ^1.0.0
- [is-string](https://npm.io/package/is-string.md) ^1.0.4
- [glob-to-regexp](https://npm.io/package/glob-to-regexp.md) ^0.1.0
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.3.3

## Recent versions

- 0.1.7 (latest) — 2016-02-02
- 0.1.6 — 2015-11-19
- 0.1.5 — 2015-11-19
- 0.1.4 — 2015-11-19
- 0.1.3 — 2015-11-19
- 0.1.2 — 2015-11-19
- 0.1.1 — 2015-11-19
- 0.1.0 — 2015-11-19
- 0.0.3 — 2015-11-19
- 0.0.2 — 2015-11-19

## README

# to-regexp
Turns wild card-style glob (`'foo*'`) and stringified regular expressions (`'/foo.*/'`) into RegExp objects.

## Install
```bash
npm install to-regexp
```

## Usage
```javascript
var toRegExp = require('to-regexp');

var re = toRegExp('foo*');
re.test('foo'); // true
re.test('foobar'); // true

var re = toRegExp('/foo.*/');
re.test('foo'); // true
re.test('foobar'); // true
```

---
_Source: https://npm.io/package/to-regexp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
