glob-to-regexp icon indicating copy to clipboard operation
glob-to-regexp copied to clipboard

Convert a glob to a regular expression

Results 9 glob-to-regexp issues
Sort by recently updated
recently updated
newest added

This library doesn't support negation globs, [here are the docs about it](https://github.com/isaacs/node-glob#glob-primer) For example calling `globToRegExp('!*.js')` returns `/^\!.*\.js$/`, which matches strings that start with the character `!`. It should return...

```js # Bad behavior. > globToRegExp('fo[oO*]bar', {extended: true}) /^fo[oO.*]bar$/ # Expected result: /^fo[oO*]bar$/ ```

adding a `\` before a glob character should treat it as a plain character. the current behavior ignores it completely. ```js # Bad behavior. > globToRegExp('foo\\*bar') /^foo\.*bar$/ # Expected result:...

Curly braces are not handled ``` > globToRegExp('./resources/lang/{en,fr}/*.json') ``` **Expected:** ``` /^\.\/resources\/lang\/(en|fr)\/.*\.json$/ ``` or (minimatch produces this): ``` /^(?:\.\/resources\/lang\/en\.json|\.\/resources\/lang\/fr\.json)$/ ``` **Actual:** ``` /^\.\/resources\/lang\/\{en\,fr\}\/.*\.json$/ ```

The idea of converting globs to regexes is a good one. However, the conversion done by this code is not correct. Using /^.*\.min\.js$/ as the regex for "*.min.js" is wrong....

Sometimes there is a requirement to capture what those stars match. So I made an extra option, which defaults to false

First of all, thanks for this great package! It would be nice if there was an official changelog or maybe release notes for each release so that we know for...

Hey Nick, Nice job... I would suggest, you can make a second version of this, for front-end (browsers js). I know it's just removing the `export...` but would be nice...