to-regexp

0.1.7 • Public • Published

to-regexp

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

Install

npm install to-regexp

Usage

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

Readme

Keywords

Package Sidebar

Install

npm i to-regexp

Weekly Downloads

10

Version

0.1.7

License

MIT

Last publish

Collaborators

  • artemis-prime
  • hanzo-io
  • zeekay