Bachir Soussi Chiadmi cefd1c2ad0 updated sys and created publi | 7 anos atrás | |
---|---|---|
.. | ||
LICENSE | 7 anos atrás | |
README.md | 7 anos atrás | |
index.js | 7 anos atrás | |
package.json | 7 anos atrás |
Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.
Install with npm
$ npm i extglob --save
Used by micromatch.
Features
{regex: true}
to return a regexvar extglob = require('extglob');
extglob('?(z)');
//=> '(?:z)?'
extglob('*(z)');
//=> '(?:z)*'
extglob('+(z)');
//=> '(?:z)+'
extglob('@(z)');
//=> '(?:z)'
extglob('!(z)');
//=> '(?!^(?:(?!z)[^/]*?)).*$'
Optionally return regex
extglob('!(z)', {regex: true});
//=> /(?!^(?:(?!z)[^/]*?)).*$/
To learn more about how extglobs work, see the docs for Bash pattern matching:
?(pattern)
: Match zero or one occurrence of the given pattern.*(pattern)
: Match zero or more occurrences of the given pattern.+(pattern)
: Match one or more occurrences of the given pattern.@(pattern)
: Match one of the given pattern.!(pattern)
: Match anything except one of the given pattern.Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on August 01, 2015.