Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 13, 2024 via pnpm

glob-to-regexp 0.4.1

Convert globs to regular expressions
Package summary
Share
0
issues
1
license
1
BSD-2-Clause
Package created
16 Jul 2013
Version published
1 Apr 2019
Maintainers
1
Total deps
1
Direct deps
0
License
BSD-2-Clause

Issues

0
This package has no issues

Licenses

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
glob-to-regexp@0.4.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of glob-to-regexp 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does glob-to-regexp do?

Glob-to-regexp is a potent tool with which you can convert wildcard-style globs into regular expressions. It turns a format like "*.min.js" into a regular expression like /^.*\.min\.js$/. The package also supports bash-like globs such as ? for single-character matches, [a-z] for character ranges, and {*.html, *.js} for multiple alternatives, offering one a great deal of flexibility in their search pattern.

How do you use glob-to-regexp?

The use of glob-to-regexp is fairly straightforward. First, you need to install it using npm by running npm install glob-to-regexp. Then, in your JavaScript code, require the module like this: var globToRegExp = require('glob-to-regexp');. Once you have the globToRegExp function available, you can call it with a glob string to get a regular expression. For example,

var re = globToRegExp("p*uck");

You can then use this regular expression with the .test() method on any string to check if it matches the pattern. For example,

re.test("pluck"); // returns true

One thing to remember is that if you want to use extended globs, you need to call globToRegExp with the second parameter as { extended: true }. For instance,

var re = globToRegExp("*/www/{*.js,*.html}", { extended: true });
re.test("http://example.com/www/app.js"); // returns true

Where are the glob-to-regexp docs?

The official documentation for glob-to-regexp is not in a separate location but rather embedded in its GitHub page. You can find all the information you need in the README file at the GitHub repository located at https://github.com/fitzgen/glob-to-regexp. In case of any updates or changes, this is the first place where any modifications will be reflected. The README file is very comprehensive, providing installation and usage instructions as well as examples of how to effectively employ glob-to-regexp.