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

5

Version

0.1.7

License

MIT

Last publish

Collaborators

  • aputy
  • musordmt
  • jason_stu
  • wbeanpro
  • artemis-prime
  • hanzo-io
  • zeekay